-
Notifications
You must be signed in to change notification settings - Fork 257
/
Copy pathcustom_css.py
31 lines (23 loc) · 1020 Bytes
/
custom_css.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtUiTools import QUiLoader
from qt_material import apply_stylesheet
import os
########################################################################
class RuntimeStylesheets(QMainWindow):
# ----------------------------------------------------------------------
def __init__(self):
""""""
super().__init__()
self.main = QUiLoader().load('main_window.ui', self)
self.main.pushButton_2.setProperty('class', 'big_button')
if __name__ == "__main__":
app = QApplication()
# apply_stylesheet(app, theme='light_blue.xml')
# stylesheet = app.styleSheet()
# # app.setStyleSheet(stylesheet + "QPushButton{color: red; text-transform: none;}")
# with open('custom.css') as file:
# app.setStyleSheet(stylesheet + file.read().format(**os.environ))
apply_stylesheet(app, theme='light_blue.xml', css_file='custom.css')
frame = RuntimeStylesheets()
frame.main.show()
app.exec_()