-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
49 lines (36 loc) · 1.07 KB
/
test.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
# importing the required libraries
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5 import QtCore
from PyQt5.QtCore import Qt
import sys
class Window(QMainWindow):
def __init__(self):
super().__init__()
# set the title
self.setWindowTitle("round label")
# setting the geometry of window
self.setGeometry(60, 60, 600, 400)
# creating a label widget
# by default label will display at top left corner
self.label_1 = QLabel('round label', self)
# moving position
self.label_1.move(100, 100)
# making label square in size
self.label_1.resize(80, 80)
# setting up border and radius
self.label_1.setStyleSheet(
"""
background-color: #000000;
border-radius: 40px;
border: 0px solid #000000;
"""
)
# show all the widgets
self.show()
# create pyqt5 app
App = QApplication(sys.argv)
# create the instance of our Window
window = Window()
# start the app
sys.exit(App.exec())