E5Application: fixed a warning related to initialisation of Qt.

Sat, 09 May 2020 11:49:12 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 09 May 2020 11:49:12 +0200
changeset 7589
c1f81fd8c33a
parent 7588
881eebfefd34
child 7590
2786c3af7a06

E5Application: fixed a warning related to initialisation of Qt.

eric6/E5Gui/E5Application.py file | annotate | diff | comparison | revisions
--- a/eric6/E5Gui/E5Application.py	Sat May 09 11:47:40 2020 +0200
+++ b/eric6/E5Gui/E5Application.py	Sat May 09 11:49:12 2020 +0200
@@ -12,6 +12,17 @@
 from PyQt5.QtGui import QPalette
 from PyQt5.QtWidgets import QApplication
 
+try:
+    QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
+    # __IGNORE_EXCEPTION__
+except AttributeError:
+    pass
+try:
+    QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
+    # __IGNORE_EXCEPTION__
+except AttributeError:
+    pass
+
 
 class E5Application(QApplication):
     """
@@ -24,17 +35,6 @@
         @param argv command line arguments
         @type list
         """
-        try:
-            QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
-            # __IGNORE_EXCEPTION__
-        except AttributeError:
-            pass
-        try:
-            QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
-            # __IGNORE_EXCEPTION__
-        except AttributeError:
-            pass
-        
         super(E5Application, self).__init__(argv)
         
         QCoreApplication.setAttribute(Qt.AA_DontCreateNativeWidgetSiblings)

eric ide

mercurial