from
PyQt5.QtWidgets
import
*
from
PyQt5
import
QtCore, QtGui
from
PyQt5.QtGui
import
*
from
PyQt5.QtCore
import
*
import
sys
class
Window(QMainWindow):
def
__init__(
self
):
super
().__init__()
self
.setWindowTitle("Python ")
self
.setGeometry(
100
,
100
,
600
,
400
)
self
.UiComponents()
self
.show()
def
UiComponents(
self
):
label1
=
QLabel(
self
)
label1.setGeometry(
200
,
150
,
100
,
50
)
label1.setStyleSheet("border :
2px
solid black;")
label2
=
QLabel("Multi label i.e With multi line",
self
)
label2.setGeometry(
200
,
250
,
100
,
50
)
label2.setStyleSheet("border :
2px
solid black;")
label2.setWordWrap(
True
)
check
=
label2.wordWrap()
if
check:
label1.setText("YESSS")
else
:
label1.setText("NOO")
App
=
QApplication(sys.argv)
window
=
Window()
window.show()
sys.exit(App.
exec
())