Skip to content
Snippets Groups Projects
Commit defb449f authored by Jonas Smedegaard's avatar Jonas Smedegaard
Browse files

set AA_EnableHighDpiScaling attribute early

This avoids Qt 5.12.4 and newer spewing a warning:

> Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
parent 7acdf0b3
Branches wip/fix_pyqt
No related tags found
No related merge requests found
......@@ -114,7 +114,6 @@ class Application(QObject):
@classmethod
def startup(cls, argv, qapp, loop):
qapp.setAttribute(Qt.AA_EnableHighDpiScaling, True)
options = SakiaOptions.from_arguments(argv)
app_data = AppDataFile.in_config_path(options.config_path).load_or_init()
app = cls(
......
......@@ -157,6 +157,12 @@ def cancel_connection(button=None):
def main():
# activate ctrl-c interrupt
signal.signal(signal.SIGINT, signal.SIG_DFL)
try:
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
except AttributeError: # Attribute only exists for Qt>=5.6.
pass
sakia = QApplication(sys.argv)
sys.excepthook = exception_handler
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment