7 Module implementing a main window class with styling support. |
7 Module implementing a main window class with styling support. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
|
12 from PyQt5.QtCore import QCoreApplication |
12 from PyQt5.QtWidgets import QMainWindow, QStyleFactory, QApplication |
13 from PyQt5.QtWidgets import QMainWindow, QStyleFactory, QApplication |
13 |
14 |
14 from .E5Application import e5App |
15 from .E5Application import e5App |
15 from . import E5MessageBox |
16 from . import E5MessageBox |
16 |
17 |
53 styleSheet = f.read() |
54 styleSheet = f.read() |
54 f.close() |
55 f.close() |
55 except (IOError, OSError) as msg: |
56 except (IOError, OSError) as msg: |
56 E5MessageBox.warning( |
57 E5MessageBox.warning( |
57 self, |
58 self, |
58 self.tr("Loading Style Sheet"), |
59 QCoreApplication.translate( |
59 self.tr( |
60 "E5MainWindow", "Loading Style Sheet"), |
|
61 QCoreApplication.translate( |
|
62 "E5MainWindow", |
60 """<p>The Qt Style Sheet file <b>{0}</b> could""" |
63 """<p>The Qt Style Sheet file <b>{0}</b> could""" |
61 """ not be read.<br>Reason: {1}</p>""") |
64 """ not be read.<br>Reason: {1}</p>""") |
62 .format(styleSheetFile, str(msg))) |
65 .format(styleSheetFile, str(msg))) |
63 return |
66 return |
64 else: |
67 else: |