-
Notifications
You must be signed in to change notification settings - Fork 257
/
Copy pathruntime.py
30 lines (21 loc) · 1.07 KB
/
runtime.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
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtUiTools import QUiLoader
from PySide6.QtGui import QFontDatabase
from qt_material import QtStyleTools
########################################################################
class RuntimeStylesheets(QMainWindow, QtStyleTools):
# ----------------------------------------------------------------------
def __init__(self):
""""""
super().__init__()
self.main = QUiLoader().load('main_window.ui', self)
self.main.pushButton.clicked.connect(lambda: self.apply_stylesheet(self.main, 'dark_teal.xml'))
self.main.pushButton_2.clicked.connect(lambda: self.apply_stylesheet(self.main, 'light_red.xml', extra={'font_family': 'mono', }))
self.main.pushButton_3.clicked.connect(lambda: self.apply_stylesheet(self.main, 'light_blue.xml', extra={'font_family': 'Raleway', }))
if __name__ == "__main__":
app = QApplication()
# Local file
QFontDatabase.addApplicationFont('Raleway-Regular.ttf')
frame = RuntimeStylesheets()
frame.main.show()
app.exec_()