diff --git a/tools/Python/mcgui/CMakeLists.txt b/tools/Python/mcgui/CMakeLists.txt index a733c4f8c..4a84f731b 100644 --- a/tools/Python/mcgui/CMakeLists.txt +++ b/tools/Python/mcgui/CMakeLists.txt @@ -52,7 +52,7 @@ set(CPACK_NSIS_DISPLAY_NAME "${NSIS_NAME}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}") # Debian -set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, ${FLAVOR}-tools-python-${P}doc, ${FLAVOR}-tools-python-mccodelib, python3, python3-pyqt5.qsci") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, ${FLAVOR}-tools-python-${P}doc, ${FLAVOR}-tools-python-mccodelib, python3, python3-pyqt6.qsci") set(CPACK_DEBIAN_PACKAGE_REPLACES "${FLAVOR}-tools-python-${P}gui-3.5.1") # RPM diff --git a/tools/Python/mcgui/mcgui.py b/tools/Python/mcgui/mcgui.py index 7d5d36ab8..6e47bca39 100755 --- a/tools/Python/mcgui/mcgui.py +++ b/tools/Python/mcgui/mcgui.py @@ -18,6 +18,7 @@ from PyQt6.QtWidgets import QApplication, QWidget from PyQt6.QtGui import QFont, QFontDatabase import PyQt6 as PyQt + try: from PyQt6 import Qsci except ImportError: @@ -28,6 +29,7 @@ from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QFont, QFontDatabase import PyQt5 as PyQt + try: from PyQt5 import Qsci except ImportError: diff --git a/tools/Python/mcgui/viewclasses.py b/tools/Python/mcgui/viewclasses.py index 07c4421e5..5faa35697 100644 --- a/tools/Python/mcgui/viewclasses.py +++ b/tools/Python/mcgui/viewclasses.py @@ -314,7 +314,7 @@ def __sbEventFilter(subject, object, event): edt = QtWidgets.QLineEdit() edt = subject # handle focus on - if event.type() == QtCore.QEvent.FocusIn: + if event.type() == QtCore.QEvent.Type.FocusIn: if edt.text() == 'search...': edt.setText('') font = QtGui.QFont() @@ -323,7 +323,7 @@ def __sbEventFilter(subject, object, event): edt.setStyleSheet("color: black;") # handle focus off - elif event.type() == QtCore.QEvent.FocusOut: + elif event.type() == QtCore.QEvent.Type.FocusOut: if edt.text() == '': font = QtGui.QFont() font.setItalic(True) @@ -332,7 +332,7 @@ def __sbEventFilter(subject, object, event): edt.setText('search...') # handle enter keypress (search) - elif event.type() == QtCore.QEvent.KeyPress: + elif event.type() == QtCore.QEvent.Type.KeyPress: # return & enter if event.key() in [0x01000004, 0x01000005]: self.__search(subject.text().casefold()) @@ -503,7 +503,7 @@ def __initScintilla(self): font.setPointSize(int(mccode_config.configuration["GUIFONTSIZE"])) # brace matching - scintilla.setBraceMatching(Qsci.QsciScintilla.SloppyBraceMatch) + scintilla.setBraceMatching(Qsci.QsciScintilla.BraceMatch.SloppyBraceMatch) # set lexer lexer = Qsci.QsciLexerCPP() @@ -518,14 +518,14 @@ def __initScintilla(self): scintilla.__myApi = Qsci.QsciAPIs(lexer) scintilla.setAutoCompletionThreshold(1) - scintilla.setAutoCompletionSource(Qsci.QsciScintilla.AcsAPIs) + scintilla.setAutoCompletionSource(Qsci.QsciScintilla.AutoCompletionSource.AcsAPIs) # remove horizontal scrollbar scintilla.SendScintilla(Qsci.QsciScintilla.SCI_SETHSCROLLBAR, 0) # display default line numbers fm = QtGui.QFontMetrics(font) - scintilla.setMarginWidth(0, fm.width( "00000" )) + scintilla.setMarginWidth(0, fm.horizontalAdvance( "00000" )) scintilla.setMarginLineNumbers(0, True) ######################## @@ -595,7 +595,7 @@ def __initCallbacks(self): # TODO: create a ctr-a on a menu to __scintilla.selectAll(bool select) def __keyEventFilterFct(subject, object, event): - if event.type() == QtCore.QEvent.KeyRelease: + if event.type() == QtCore.QEvent.Type.KeyRelease: # ctrl-q if event.key() == 81 and int(event.modifiers()) == 67108864: self.close() @@ -1024,7 +1024,7 @@ def _wEventFilter(subject, object, event): edt = QtWidgets.QLineEdit() edt = subject # handle focus on - if event.type() == QtCore.QEvent.FocusIn: + if event.type() == QtCore.QEvent.Type.FocusIn: if edt.text() == edt.defval: edt.setText('') font = QtGui.QFont() @@ -1034,7 +1034,7 @@ def _wEventFilter(subject, object, event): edt.setCursorPosition(0) # handle focus off - elif event.type() == QtCore.QEvent.FocusOut: + elif event.type() == QtCore.QEvent.Type.FocusOut: if edt.text() == '': font = QtGui.QFont() font.setItalic(True) diff --git a/tools/Python/mcplot/matplotlib/CMakeLists.txt b/tools/Python/mcplot/matplotlib/CMakeLists.txt index 751dcf2b9..86cc2a54b 100644 --- a/tools/Python/mcplot/matplotlib/CMakeLists.txt +++ b/tools/Python/mcplot/matplotlib/CMakeLists.txt @@ -52,7 +52,7 @@ set(CPACK_NSIS_DISPLAY_NAME "${NSIS_NAME}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}") # Debian -set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3-matplotlib, python3-pyqt5, python3-mplexporter, python3-tornado") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "${FLAVOR}, python3-matplotlib, python3-pyqt6, python3-mplexporter, python3-tornado") set(CPACK_DEBIAN_PACKAGE_REPLACES "${FLAVOR}-tools-python-${P}plot-matplotlib-3.5.1") # RPM