-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSuttonKioskTest.py
64 lines (46 loc) · 1.93 KB
/
SuttonKioskTest.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
from PyQt5.QtCore import Qt
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QGridLayout, QLabel, QLineEdit, QTextEdit, QWidget
from PyQt5.QtWidgets import (QApplication, QGridLayout, QLayout, QLineEdit,
QSizePolicy, QToolButton, QWidget)
class Button(QToolButton):
def __init__(self, text, suttonKioskTest, parent=None):
super(Button, self).__init__(parent)
self.suttonKioskTest = suttonKioskTest
self.text = text
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
self.setText(text)
def sizeHint(self):
size = super(Button, self).sizeHint()
size.setHeight(size.height() + 20)
size.setWidth(max(size.width(), size.height()))
return size
def mousePressEvent(self, event):
self.suttonKioskTest.goToNextScreen()
class SuttonKioskTest(QWidget):
def __init__(self, parent=None):
super(SuttonKioskTest, self).__init__(parent)
seanDoyleButton = Button("Sean Doyle", self)
mainLayout = QGridLayout()
#mainLayout.setFixedSize(500,500)
mainLayout.addWidget(seanDoyleButton, 0, 0)
self.setLayout(mainLayout)
self.setWindowTitle("Sutton Buck Kiosk")
def goToNextScreen(self):
nameLabel = QLabel("Sean Doyle")
amountLabel = QLabel("Sutton Bucks: 10")
calculatorLabel = Button("Buy A calculator: 5 SB", self)
soulLabel = Button("Buy a soul: 100 SB", self)
mainLayout = QGridLayout()
mainLayout.addWidget(nameLabel, 0, 0)
mainLayout.addWidget(amountLabel, 1, 0)
mainLayout.addWidget(calculatorLabel,2,0)
mainLayout.addWidget(soulLabel,3,0)
SuttonKioskTest().setLayout(mainLayout)
if __name__ == '__main__':
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
addressBook = SuttonKioskTest()
addressBook.show()
sys.exit(app.exec_())