src/eric7/EricWidgets/EricMainWindow.py

branch
eric7
changeset 10248
981456110843
parent 10180
3a595df36c9a
child 10439
21c28b0f9e41
equal deleted inserted replaced
10247:81f8846b62ad 10248:981456110843
8 """ 8 """
9 9
10 from PyQt6.QtWidgets import QApplication, QMainWindow, QStyleFactory 10 from PyQt6.QtWidgets import QApplication, QMainWindow, QStyleFactory
11 11
12 from .EricApplication import ericApp 12 from .EricApplication import ericApp
13 from .EricProxyStyle import EricProxyStyle
13 14
14 15
15 class EricMainWindow(QMainWindow): 16 class EricMainWindow(QMainWindow):
16 """ 17 """
17 Class implementing a main window with styling support. 18 Class implementing a main window with styling support.
42 style = None 43 style = None
43 if styleName != "System" and styleName in QStyleFactory.keys(): # noqa: Y118 44 if styleName != "System" and styleName in QStyleFactory.keys(): # noqa: Y118
44 style = QStyleFactory.create(styleName) 45 style = QStyleFactory.create(styleName)
45 if style is None: 46 if style is None:
46 style = QStyleFactory.create(self.defaultStyleName) 47 style = QStyleFactory.create(self.defaultStyleName)
47 if style is not None: 48
48 QApplication.setStyle(style) 49 if style is None:
50 QApplication.setStyle(EricProxyStyle())
51 else:
52 QApplication.setStyle(EricProxyStyle(style))
49 53
50 # step 2: set a style sheet 54 # step 2: set a style sheet
51 ericApp().setStyleSheetFile(styleSheetFile) 55 ericApp().setStyleSheetFile(styleSheetFile)

eric ide

mercurial