remove QT4 references

This commit is contained in:
andrea reale
2022-03-03 16:13:15 +01:00
committed by wmayer
parent 06959ededb
commit 13e09b36f8
15 changed files with 17 additions and 119 deletions

View File

@@ -28,7 +28,6 @@ if(MSVC)
importlib_umfpackamd.lib
${SMSH_LIBRARIES}
${SMESH_LIBRARIES}
#OCCAdaptMesh
)
else(MSVC)
set(CamGui_LIBS
@@ -47,7 +46,7 @@ SOURCE_GROUP("Moc" FILES ${CamGui_MOC_SRCS})
set(CamGui_UIC_SRCS
Cutting.ui
)
qt4_wrap_ui(CamGui_UIC_HDRS ${CamGui_UIC_SRCS})
qt5_wrap_ui(CamGui_UIC_HDRS ${CamGui_UIC_SRCS})
SET(CamGui_SRCS
${CamGui_UIC_HDRS}

View File

@@ -168,16 +168,6 @@ class TaskPanelCircularArray:
self.form.checkbox_fuse.stateChanged.connect(self.set_fuse)
self.form.checkbox_link.stateChanged.connect(self.set_link)
# Old style for Qt4, avoid!
# QtCore.QObject.connect(self.form.button_reset,
# QtCore.SIGNAL("clicked()"),
# self.reset_point)
# QtCore.QObject.connect(self.form.checkbox_fuse,
# QtCore.SIGNAL("stateChanged(int)"),
# self.set_fuse)
# QtCore.QObject.connect(self.form.checkbox_link,
# QtCore.SIGNAL("stateChanged(int)"),
# self.set_link)
def accept(self):
"""Execute when clicking the OK button or Enter key."""

View File

@@ -167,10 +167,6 @@ class TaskPanelOrthoArray:
self.form.checkbox_fuse.stateChanged.connect(self.set_fuse)
self.form.checkbox_link.stateChanged.connect(self.set_link)
# Old style for Qt4, avoid!
# QtCore.QObject.connect(self.form.button_reset,
# QtCore.SIGNAL("clicked()"),
# self.reset_point)
def accept(self):
"""Execute when clicking the OK button or Enter key."""

View File

@@ -156,10 +156,6 @@ class TaskPanelPolarArray:
self.form.checkbox_fuse.stateChanged.connect(self.set_fuse)
self.form.checkbox_link.stateChanged.connect(self.set_link)
# Old style for Qt4, avoid!
# QtCore.QObject.connect(self.form.button_reset,
# QtCore.SIGNAL("clicked()"),
# self.reset_point)
def accept(self):
"""Execute when clicking the OK button or Enter key."""

View File

@@ -38,10 +38,6 @@ import six
Qtranslate = QtCore.QCoreApplication.translate
# This property only exists in Qt4, which is normally paired
# with Python 2.
# But if Python 2 is used with Qt5 (rare),
# this assignment will fail.
try:
_encoding = QtGui.QApplication.UnicodeUTF8
except AttributeError:
@@ -115,35 +111,7 @@ def translate(context, text, utf8_decode=False):
# the translate function doesn't use the 4th parameter
if six.PY3:
return Qtranslate(context, text, None)
# Python 2
elif QtCore.qVersion() > "4":
# Python 2 and Qt5
if utf8_decode:
# The text is a utf8 string, and since it is Qt5
# the translate function doesn't use the 4th parameter
return Qtranslate(context, text, None)
else:
# The text is not a unicode string, and since it is Qt5
# the translate function doesn't use the 4th parameter.
# Therefore the output string needs to be encoded manually
# as utf8 bytes before returning.
return Qtranslate(context, text, None).encode("utf8")
else:
# Python 2 and Qt4
if utf8_decode:
# The text is a utf8 string, and since it is Qt4
# the translate function uses the 4th parameter
# to handle the input encoding.
return Qtranslate(context, text, None, _encoding)
else:
# The text is not a unicode string, and since it is Qt4
# the translate function uses the 4th parameter
# to handle the encoding.
# In this case, the `encoding` is `None`, therefore
# the output string needs to be encoded manually
# as utf8 bytes before returning.
return Qtranslate(context, text, None, _encoding).encode("utf8")
# Original code no longer used. It is listed here for reference
# to show how the different pairings Py2/Qt4, Py3/Qt5, Py2/Qt5, Py3/Qt4

View File

@@ -228,7 +228,6 @@ void TaskRichAnno::setUiPrimary()
MRichTextEdit mre;
ui->teAnnoText->setFontPointSize(mre.getDefFontSizeNum());
// set a placeholder text to inform the user
// (QTextEdit has no placeholderText property in Qt4)
ui->teAnnoText->setPlaceholderText(tr("Input the annotation text directly or start the rich text editor"));
}