From 30802901c79552e76a1814fc19cad86d63f64e3d Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 28 Aug 2021 22:42:44 +0300 Subject: [PATCH] - removed the setting for HDPI from Preferences and QSettings: QT6 does it automatically now --- CHANGELOG.md | 4 +++ FlatCAM.py | 27 ------------------- appGUI/MainGUI.py | 5 ++-- .../general/GeneralGUIPrefGroupUI.py | 25 ----------------- 4 files changed, 7 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ba4860..43e976df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta ================================================= +28.08.2021 + +- removed the setting for HDPI from Preferences and QSettings: QT6 does it automatically now + 26.08.2021 - updated the Italian translation by Massimiliano Golfetto diff --git a/FlatCAM.py b/FlatCAM.py index fee30a4f..99f96b38 100644 --- a/FlatCAM.py +++ b/FlatCAM.py @@ -104,32 +104,6 @@ if __name__ == '__main__': debug_trace() VisPyPatches.apply_patches() - # apply High DPI support - settings = QSettings("Open Source", "FlatCAM") - if settings.contains("hdpi"): - hdpi_support = settings.value('hdpi', type=int) - else: - hdpi_support = 0 - - if hdpi_support == 2: - os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" - else: - os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "0" - - # if hdpi_support == 2: - # tst_screen = QtWidgets.QApplication(sys.argv) - # if tst_screen.screens()[0].geometry().width() > 1930 or tst_screen.screens()[1].geometry().width() > 1930: - # QGuiApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True) - # del tst_screen - # 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) - - def excepthook(exc_type, exc_value, exc_tb): msg = '%s\n' % str(datetime.today()) if exc_type != KeyboardInterrupt: @@ -151,7 +125,6 @@ if __name__ == '__main__': sys.excepthook = excepthook app = QtWidgets.QApplication(sys.argv) - # app.setAttribute(Qt.AA_UseHighDpiPixmaps) # apply style settings = QSettings("Open Source", "FlatCAM") diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 5a0be7fc..41facbfa 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -1617,13 +1617,14 @@ class MainGUI(QtWidgets.QMainWindow): self.clear_btn.setToolTip( _("Clear the GUI settings for FlatCAM,\n" - "such as: layout, gui state, style, hdpi support etc.") + "such as: layout, gui state, style etc.") ) self.pref_tab_bottom_layout_1.addWidget(self.clear_btn) self.pref_tab_bottom_layout_2 = QtWidgets.QHBoxLayout() - self.pref_tab_bottom_layout_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter) + self.pref_tab_bottom_layout_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | + QtCore.Qt.AlignmentFlag.AlignVCenter) self.pref_tab_bottom_layout.addLayout(self.pref_tab_bottom_layout_2) self.pref_apply_button = FCButton() diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index c990d827..4c9faaea 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -104,22 +104,6 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.style_label, 5, 0) grid0.addWidget(self.style_combo, 5, 1) - # Enable High DPI Support - self.hdpi_cb = FCCheckBox('%s' % _('HDPI Support')) - self.hdpi_cb.setToolTip( - _("Enable High DPI support for the application.\n" - "It will be applied at the next app start.") - ) - - qsettings = QSettings("Open Source", "FlatCAM") - if qsettings.contains("hdpi"): - self.hdpi_cb.set_value(qsettings.value('hdpi', type=int)) - else: - self.hdpi_cb.set_value(False) - self.hdpi_cb.stateChanged.connect(self.handle_hdpi) - - grid0.addWidget(self.hdpi_cb, 6, 0, 1, 3) - # Enable Hover box self.hover_cb = FCCheckBox('%s' % _('Hover Shape')) self.hover_cb.setToolTip( @@ -334,15 +318,6 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # This will write the setting to the platform specific storage. del qsettings - @staticmethod - def handle_hdpi(state): - # set current HDPI - qsettings = QSettings("Open Source", "FlatCAM") - qsettings.setValue('hdpi', state) - - # This will write the setting to the platform specific storage. - del qsettings - # Setting selection colors (left - right) handlers def on_sf_color_entry(self): self.app.defaults['global_sel_fill'] = self.app.defaults['global_sel_fill'][7:9]