-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
38 lines (28 loc) · 1.02 KB
/
main.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
from PySide.QtCore import Qt, QTimer, QUrl
from PySide.QtGui import QApplication
from PySide.QtDeclarative import QDeclarativeView
from BuglistModel import Bugzilla
from PieChart import registerComponents
class FullScreenSwitcherView(QDeclarativeView):
def keyPressEvent(self, event):
if event.key() == Qt.Key_F11:
self.setWindowState(self.windowState() ^ Qt.WindowFullScreen)
event.accept()
QDeclarativeView.keyPressEvent(self, event)
def main():
QApplication.setGraphicsSystem('raster')
app = QApplication([])
bug = Bugzilla()
# Register PieChart components
registerComponents()
view = FullScreenSwitcherView()
view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
view.rootContext().setContextProperty('bugmodel', bug)
view.setSource(QUrl.fromLocalFile('./qml/Board.qml'))
timer = QTimer()
timer.timeout.connect(bug.update)
timer.start(1000 * 60 * 10)
view.showFullScreen()
app.exec_()
if __name__ == '__main__':
main()