-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUI.py
74 lines (55 loc) · 2.41 KB
/
UI.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from datetime import date
from PyQt5.QtWidgets import(QWidget,
QComboBox,
QStackedLayout,
QVBoxLayout,
QApplication)
from SportlerEdit import SportlerEdit
from SportlerShow import SportlerShow
from ErgebnissListe import ErgebnissListe
from ErgebnisseDrucken import ErgebnisseDrucken
from ErgebnissVorlage import ErgebnissVorlage
class MainWindow(QWidget):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.actionAuswahl = QComboBox()
self.actionAuswahl.addItem("Einen Sportler bearbeiten")
self.actionAuswahl.addItem("Liste aller Sportler anzeigen")
self.actionAuswahl.addItem("Eine Ergebnissliste bearbeiten")
self.actionAuswahl.addItem("Ergebnisse & Urkunden drucken")
self.actionAuswahl.addItem("Ergebnissvorlagen drucken")
self.actionAuswahl.setEditable(False)
self.actionAuswahl.activated.connect(self.setAction)
self.actionSportlerEdit = SportlerEdit()
self.actionSportlerShow = SportlerShow()
self.actionErgebnissListe = ErgebnissListe()
self.actionErgebnisseDrucken = ErgebnisseDrucken()
self.actionErgebnissVorlage = ErgebnissVorlage()
self.actionLayout = QStackedLayout()
self.actionLayout.addWidget(self.actionSportlerEdit)
self.actionLayout.addWidget(self.actionSportlerShow)
self.actionLayout.addWidget(self.actionErgebnissListe)
self.actionLayout.addWidget(self.actionErgebnisseDrucken)
self.actionLayout.addWidget(self.actionErgebnissVorlage)
self.mainLayout = QVBoxLayout()
self.mainLayout.addWidget(self.actionAuswahl)
self.mainLayout.addStretch(0)
self.mainLayout.addLayout(self.actionLayout)
self.mainLayout.addStretch(0)
self.setLayout(self.mainLayout)
self.show()
def setAction(self,index):
self.actionLayout.setCurrentIndex(index)
self.actionLayout.currentWidget().update()
if __name__ == '__main__':
import os
if not os.path.isfile("daten.db"):
os.system("sqlite3 daten.db < setup.sql")
import sys
app = QApplication(sys.argv)
import TestPackage
Window = MainWindow()
Window.setWindowTitle("Kinderolympiade {}".format(date.today().year))
Window.resize(640, 480)
Window.show()
sys.exit(app.exec_())