13 from PyQt6.QtGui import QColor, QPalette |
13 from PyQt6.QtGui import QColor, QPalette |
14 from PyQt6.QtWidgets import QApplication |
14 from PyQt6.QtWidgets import QApplication |
15 |
15 |
16 if not QCoreApplication.testAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts): |
16 if not QCoreApplication.testAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts): |
17 QCoreApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts, True) |
17 QCoreApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts, True) |
|
18 |
|
19 from eric7.SystemUtilities import FileSystemUtilities |
18 |
20 |
19 from . import EricMessageBox |
21 from . import EricMessageBox |
20 |
22 |
21 |
23 |
22 class EricApplication(QApplication): |
24 class EricApplication(QApplication): |
186 False) |
188 False) |
187 @type bool (optional) |
189 @type bool (optional) |
188 @return directory path containing the style icons |
190 @return directory path containing the style icons |
189 @rtype str |
191 @rtype str |
190 """ |
192 """ |
191 from eric7 import Preferences, Utilities |
193 from eric7 import Preferences |
192 from eric7.Globals import getConfig |
194 from eric7.Globals import getConfig |
193 |
195 |
194 styleIconsPath = Preferences.getUI("StyleIconsPath") |
196 styleIconsPath = Preferences.getUI("StyleIconsPath") |
195 if not styleIconsPath: |
197 if not styleIconsPath: |
196 # default is the 'StyleIcons' sub-directory of the icons |
198 # default is the 'StyleIcons' sub-directory of the icons |
197 # directory |
199 # directory |
198 styleIconsPath = os.path.join(getConfig("ericIconDir"), "StyleIcons") |
200 styleIconsPath = os.path.join(getConfig("ericIconDir"), "StyleIcons") |
199 |
201 |
200 if universal: |
202 if universal: |
201 return Utilities.fromNativeSeparators(styleIconsPath) |
203 return FileSystemUtilities.fromNativeSeparators(styleIconsPath) |
202 else: |
204 else: |
203 return styleIconsPath |
205 return styleIconsPath |
204 |
206 |
205 def setStyleSheetFile(self, filename): |
207 def setStyleSheetFile(self, filename): |
206 """ |
208 """ |