-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpyqx.py
43 lines (28 loc) · 909 Bytes
/
pyqx.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
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3:
#coding: utf-8
import sys, os
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import Qt
from mainwindow import MainWindow
from signals import Signals
from context import Context
def readCSS(fname):
f = open(fname, 'r')
s = f.read()
f.close()
return s
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
#app.setWindowIcon(QtWidgets.QIcon("images/icon.png"))
sys.setrecursionlimit(4096*4096)
customFnt = "Lato-Reg.ttf"
if QtGui.QFontDatabase().addApplicationFont(os.path.join("fonts", customFnt)) < 0:
print("Warning: Could not load custom font" + customFnt + ", falling back to default font.")
else:
fnt = QtGui.QFont("Lato", 10)
app.setFont(fnt)
signals = Signals()
context = Context(signals)
mw = MainWindow(context, signals)
mw.setStyleSheet(readCSS(os.path.join("themes", "algae", "style.css")))
sys.exit(app.exec_())