10 |
10 |
11 from PyQt5.QtCore import Qt, QCoreApplication |
11 from PyQt5.QtCore import Qt, QCoreApplication |
12 from PyQt5.QtGui import QPalette |
12 from PyQt5.QtGui import QPalette |
13 from PyQt5.QtWidgets import QApplication |
13 from PyQt5.QtWidgets import QApplication |
14 |
14 |
|
15 try: |
|
16 QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) |
|
17 # __IGNORE_EXCEPTION__ |
|
18 except AttributeError: |
|
19 pass |
|
20 try: |
|
21 QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts) |
|
22 # __IGNORE_EXCEPTION__ |
|
23 except AttributeError: |
|
24 pass |
|
25 |
15 |
26 |
16 class E5Application(QApplication): |
27 class E5Application(QApplication): |
17 """ |
28 """ |
18 Eric application class with an object registry. |
29 Eric application class with an object registry. |
19 """ |
30 """ |
22 Constructor |
33 Constructor |
23 |
34 |
24 @param argv command line arguments |
35 @param argv command line arguments |
25 @type list |
36 @type list |
26 """ |
37 """ |
27 try: |
|
28 QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) |
|
29 # __IGNORE_EXCEPTION__ |
|
30 except AttributeError: |
|
31 pass |
|
32 try: |
|
33 QCoreApplication.setAttribute(Qt.AA_ShareOpenGLContexts) |
|
34 # __IGNORE_EXCEPTION__ |
|
35 except AttributeError: |
|
36 pass |
|
37 |
|
38 super(E5Application, self).__init__(argv) |
38 super(E5Application, self).__init__(argv) |
39 |
39 |
40 QCoreApplication.setAttribute(Qt.AA_DontCreateNativeWidgetSiblings) |
40 QCoreApplication.setAttribute(Qt.AA_DontCreateNativeWidgetSiblings) |
41 try: |
41 try: |
42 QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps) |
42 QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps) |