Browse Source

hotfix for new qt release

master
Nils 4 years ago
parent
commit
5b2b4c0f2d
  1. 5
      template/qtgui/submenus.py
  2. 6
      template/start.py

5
template/qtgui/submenus.py

@ -50,10 +50,13 @@ class Submenu(QtWidgets.QDialog):
#self.setFocus(); #self.grabKeyboard(); #redundant for a proper modal dialog. Leave here for documentation reasons.
if hasOkCancelButtons:
if hasOkCancelButtons == 1: #or true
self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
self.buttonBox.accepted.connect(self.process)
self.buttonBox.rejected.connect(self.reject)
elif hasOkCancelButtons == 2: #only cancel. #TODO: unpythonic.
self.buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel)
self.buttonBox.rejected.connect(self.reject)
else:
self.buttonBox = None

6
template/start.py

@ -144,11 +144,11 @@ else:
logger.info("PATHS: {}".format(PATHS))
#Construct QAppliction before constantsAndCOnfigs, which has the fontDB
QtGui.QGuiApplication.setDesktopSettingsAware(False) #We need our own font so the user interface stays predictable
QtGui.QGuiApplication.setDesktopFileName(PATHS["desktopfile"])
#QtGui.QGuiApplication.setDesktopSettingsAware(False) #This will crash with new Qt!
qtApp = QApplication(sys.argv)
setPaletteAndFont(qtApp)
QApplication.setStyle(QStyleFactory.create("Fusion"))
setPaletteAndFont(qtApp)
def exitWithMessage(message:str):
title = f"""{METADATA["name"]} Error"""

Loading…
Cancel
Save