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