Debian Codegraph @

examples/runtime/custom_css.py

raw symbols SCIP
1 from PySide6.QtWidgets import QApplication, QMainWindow
2 from PySide6.QtUiTools import QUiLoader
3 from qt_material import apply_stylesheet
4 import os
5
6
7 ########################################################################
8 class RuntimeStylesheets(QMainWindow):
9 # ----------------------------------------------------------------------
10 def __init__(self):
11 """"""
12 super().__init__()
13 self.main = QUiLoader().load('main_window.ui', self)
14 self.main.pushButton_2.setProperty('class', 'big_button')
15
16
17 if __name__ == "__main__":
18 app = QApplication()
19
20 # apply_stylesheet(app, theme='light_blue.xml')
21
22 # stylesheet = app.styleSheet()
23 # # app.setStyleSheet(stylesheet + "QPushButton{color: red; text-transform: none;}")
24 # with open('custom.css') as file:
25 # app.setStyleSheet(stylesheet + file.read().format(**os.environ))
26
27 apply_stylesheet(app, theme='light_blue.xml', css_file='custom.css')
28
29 frame = RuntimeStylesheets()
30 frame.main.show()
31 app.exec_()