- made sure that the HDPI scaling attribute is set before the QApplication is started

- made sure that when saving a project, the app will try to update the active object from UI form only if there is an active object
This commit is contained in:
Marius Stanciu 2020-04-05 13:48:47 +03:00 committed by Marius
parent 376c8058d9
commit bee2a9dddc
3 changed files with 13 additions and 6 deletions

View File

@ -55,6 +55,11 @@ if __name__ == '__main__':
# else: # else:
# QGuiApplication.setAttribute(Qt.AA_EnableHighDpiScaling, False) # QGuiApplication.setAttribute(Qt.AA_EnableHighDpiScaling, False)
if hdpi_support == 2:
QtWidgets.QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
else:
QtWidgets.QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, False)
app = QtWidgets.QApplication(sys.argv) app = QtWidgets.QApplication(sys.argv)
# apply style # apply style
@ -63,11 +68,6 @@ if __name__ == '__main__':
style = settings.value('style', type=str) style = settings.value('style', type=str)
app.setStyle(style) app.setStyle(style)
if hdpi_support == 2:
app.setAttribute(Qt.AA_EnableHighDpiScaling, True)
else:
app.setAttribute(Qt.AA_EnableHighDpiScaling, False)
fc = App() fc = App()
sys.exit(app.exec_()) sys.exit(app.exec_())

View File

@ -12809,7 +12809,9 @@ class App(QtCore.QObject):
# Capture the latest changes # Capture the latest changes
# Current object # Current object
try: try:
self.collection.get_active().read_form() current_object = self.collection.get_active()
if current_object:
current_object.read_form()
except Exception as e: except Exception as e:
self.log.debug("save_project() --> There was no active object. Skipping read_form. %s" % str(e)) self.log.debug("save_project() --> There was no active object. Skipping read_form. %s" % str(e))
pass pass

View File

@ -9,6 +9,11 @@ CAD program, and create G-Code for Isolation routing.
================================================= =================================================
5.04.2020
- made sure that the HDPI scaling attribute is set before the QApplication is started
- made sure that when saving a project, the app will try to update the active object from UI form only if there is an active object
4.04.2020 4.04.2020
- fixed the Repeated code parsing in Excellon Parse - fixed the Repeated code parsing in Excellon Parse