From bee2a9dddca45afe2946cdbc7e0ae0786d629004 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 5 Apr 2020 13:48:47 +0300 Subject: [PATCH] - 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 --- FlatCAM.py | 10 +++++----- FlatCAMApp.py | 4 +++- README.md | 5 +++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/FlatCAM.py b/FlatCAM.py index 02c56c9d..eb7410b2 100644 --- a/FlatCAM.py +++ b/FlatCAM.py @@ -55,6 +55,11 @@ if __name__ == '__main__': # else: # 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) # apply style @@ -63,11 +68,6 @@ if __name__ == '__main__': style = settings.value('style', type=str) app.setStyle(style) - if hdpi_support == 2: - app.setAttribute(Qt.AA_EnableHighDpiScaling, True) - else: - app.setAttribute(Qt.AA_EnableHighDpiScaling, False) - fc = App() sys.exit(app.exec_()) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index e95e6085..f23c700a 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -12809,7 +12809,9 @@ class App(QtCore.QObject): # Capture the latest changes # Current object try: - self.collection.get_active().read_form() + current_object = self.collection.get_active() + if current_object: + current_object.read_form() except Exception as e: self.log.debug("save_project() --> There was no active object. Skipping read_form. %s" % str(e)) pass diff --git a/README.md b/README.md index d8ff21c6..f540a075 100644 --- a/README.md +++ b/README.md @@ -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 - fixed the Repeated code parsing in Excellon Parse