-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
26 lines (22 loc) · 780 Bytes
/
utils.py
File metadata and controls
26 lines (22 loc) · 780 Bytes
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
import traceback
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from pprint import PrettyPrinter
pp = PrettyPrinter(indent=4).pprint
def dumpException(e):
print('%s EXCEPTION:'%e.__class__.__name__, e)
traceback.print_tb(e.__traceback__)
def loadStylesheet(filename):
print('Style loading:', filename)
file = QFile(filename)
file.open(QFile.ReadOnly | QFile.Text)
stylesheet = file.readAll()
QApplication.instance().setStyleSheet(str(stylesheet, encoding='utf-8'))
def loadStylesheets(*args):
res = ''
for arg in args:
file = QFile(arg)
file.open(QFile.ReadOnly | QFile.Text)
stylesheet = file.readAll()
res += '\n' + str(stylesheet, encoding='utf-8')
QApplication.instance().setStyleSheet(res)