-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabel.py
More file actions
50 lines (39 loc) · 1.4 KB
/
label.py
File metadata and controls
50 lines (39 loc) · 1.4 KB
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
import sys
from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout
from PyQt6.QtCore import Qt
class AplikasiKita(QWidget):
def __init__(self) -> None:
super().__init__()
self.inisialisasi_interface()
def inisialisasi_interface(self) -> None:
self.setWindowTitle("contoh aplikasi kita")
self.setGeometry(300, 300, 400, 200)
self.label_sambutan: QLabel = QLabel("wello apa kabar dari si PyQt6", self)
self.label_sambutan.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label_sambutan.setStyleSheet(
"""
font-size: 24px;
font-weight: bold;
color: "blue";
background-color: #ecf0f1;
padding: 15px;
border-radius: 10px;
"""
)
self.label_kedua: QLabel = QLabel("wello apa kabar lagi", self)
self.label_kedua.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.label_kedua.setStyleSheet(
"""
font-size: 25px;
font-weight: bold;
"""
)
self.layout_utama: QVBoxLayout = QVBoxLayout()
self.layout_utama.addWidget(self.label_sambutan)
self.layout_utama.addWidget(self.label_kedua)
self.setLayout(self.layout_utama)
if __name__ == "__main__":
aplikasi: QApplication = QApplication(sys.argv)
jendela: AplikasiKita = AplikasiKita()
jendela.show()
sys.exit(aplikasi.exec())