-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.py
58 lines (48 loc) · 1.73 KB
/
Package.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
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QFont
from PyQt6.QtWidgets import QLabel, QVBoxLayout
class Package(QLabel):
def __init__(self, value):
super().__init__()
self.setFixedSize(150, 150)
self.setStyleSheet("""
background-color: #000;
color: white;
font-weight: bold;
padding: 2px;
border-radius: 10px;
border: 1.5px solid rgba(120, 54, 31, 0.7);
""")
self.package_label = QLabel()
self.label = QLabel()
self.package_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label.setAlignment(Qt.AlignmentFlag.AlignCenter)
font = QFont()
font.setPointSize(30)
self.package_label.setFixedSize(120, 50)
self.package_label.setFont(font)
self.package_label.setStyleSheet("""
color: white;
background-color: #000;
border: 2px solid #000;
font-weight: bold;
""")
font = QFont()
font.setPointSize(18)
self.label.setFont(font)
self.label.setText("PAKET\nNUMARASI")
self.label.setStyleSheet("""
color: white;
background-color: #000;
border: 2px solid #000;
""")
self.label.setFixedSize(120, 60)
vbox = QVBoxLayout()
vbox.addWidget(self.label)
vbox.addWidget(self.package_label)
self.setLayout(vbox)
self.package_label.setText(value)
def update_package(self, value):
data = str(int(value))
self.setAlignment(Qt.AlignmentFlag.AlignCenter)
return self.package_label.setText(data)