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) |