- few changes in the Milling UI

- made some changes in the application to prepare for usage of PyQt6
This commit is contained in:
Marius Stanciu
2020-12-08 17:55:41 +02:00
committed by Marius
parent d843cf7da7
commit 5a6271be09
6 changed files with 13 additions and 7 deletions

View File

@@ -2653,7 +2653,7 @@ class FCDetachableTab(QtWidgets.QTabWidget):
self.protect_by_name = protect_by_name if isinstance(protect_by_name, list) else None
# Close all detached tabs if the application is closed explicitly
QtWidgets.qApp.aboutToQuit.connect(self.closeDetachedTabs) # @UndefinedVariable
QtCore.QCoreApplication.instance().aboutToQuit.connect(self.closeDetachedTabs) # @UndefinedVariable
# used by the property self.useOldIndex(param)
self.use_old_index = None

View File

@@ -1831,7 +1831,7 @@ class MainGUI(QtWidgets.QMainWindow):
self.tools2_defaults_form = Tools2PreferencesUI(decimals=self.decimals)
self.util_defaults_form = UtilPreferencesUI(decimals=self.decimals)
QtWidgets.qApp.installEventFilter(self)
QtCore.QCoreApplication.instance().installEventFilter(self)
# ########################################################################
# ################## RESTORE THE TOOLBAR STATE from file #################
@@ -4101,10 +4101,10 @@ class MainGUI(QtWidgets.QMainWindow):
# pos = QtCore.QPoint((self.shell._edit.width() - 40), (self.shell._edit.height() - 2))
# e = QtGui.QMouseEvent(QtCore.QEvent.MouseButtonPress, pos, QtCore.Qt.LeftButton, QtCore.Qt.LeftButton,
# no_km)
# QtWidgets.qApp.sendEvent(self.shell._edit, e)
# QtCore.QCoreApplication.instance().sendEvent(self.shell._edit, e)
# f = QtGui.QMouseEvent(QtCore.QEvent.MouseButtonRelease, pos, QtCore.Qt.LeftButton, QtCore.Qt.LeftButton,
# no_km)
# QtWidgets.qApp.sendEvent(self.shell._edit, f)
# QtCore.QCoreApplication.instance().sendEvent(self.shell._edit, f)
def on_shelldock_toggled(self, visibility):
if visibility is True:

View File

@@ -100,7 +100,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
self.style_combo = FCComboBox()
self.style_combo.addItems(QtWidgets.QStyleFactory.keys())
# find current style
index = self.style_combo.findText(QtWidgets.qApp.style().objectName(), QtCore.Qt.MatchFixedString)
current_style = QtCore.QCoreApplication.instance().style().objectName()
index = self.style_combo.findText(current_style, QtCore.Qt.MatchFixedString)
self.style_combo.setCurrentIndex(index)
self.style_combo.activated[str].connect(self.handle_style)