from
PyQt5.QtWidgets
import
*
from
PyQt5.QtGui
import
*
import
sys
class
Window(QMainWindow):
def
__init__(
self
):
super
().__init__()
self
.setWindowTitle(
"Label"
)
self
.setGeometry(
0
,
0
,
400
,
300
)
self
.label_1
=
QLabel(
'back'
,
self
)
self
.label_1.move(
100
,
100
)
self
.label_1.setStyleSheet("background
-
color: lightgreen;
border:
3px
solid green")
self
.label_2
=
QLabel(
'front'
,
self
)
self
.label_2.move(
140
,
100
)
self
.label_2.setStyleSheet("border:
3px
solid blue;
background
-
color: rgba(
0
,
255
,
255
,
90
);")
self
.show()
App
=
QApplication(sys.argv)
window
=
Window()
sys.exit(App.
exec
())