-
Notifications
You must be signed in to change notification settings - Fork 0
/
QLabel.py
34 lines (29 loc) · 998 Bytes
/
QLabel.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
from PyQt5.QtWidgets import QApplication, QLabel, QDialog, QVBoxLayout
import sys
from PyQt5 import QtGui
class Window(QDialog):
def __init__(self):
super().__init__()
self.title = "PyQt5 Labels"
self.top = 200
self.left = 500
self.width = 400
self.height = 300
self.InitWindow()
def InitWindow(self):
self.setWindowIcon(QtGui.QIcon("icon.png"))
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
vbox = QVBoxLayout()
label = QLabel("This Is PyQt5 Labels")
vbox.addWidget(label)
label2 = QLabel("This Is PyQt5 GUI Applicaition Development, Hello")
label2.setFont(QtGui.QFont("Sanserif", 20))
label2.setStyleSheet('color:red')
vbox.addWidget(label2)
self.setLayout(vbox)
self.show()
if __name__ == "__main__":
App = QApplication(sys.argv)
window = Window()
sys.exit(App.exec())