PyQt5 Fundamentals #part3

In this lesson we are going to learn Qlabel. The QLabel is one of the simplest widgets in PyQt with the ability to display lines of text. This widget comes with many supporting functions and methods to allow us to retrieve and update this text whenever we want.
for this now we will make another file in our directory and call it class3.py then we will import important files that we would need in order to get started.
now we are going to make our class as it is

now we are going to update some changes and make a label
the various changes are: we need to make a label we define a variable called label and pass window
Calling the QtWidgets.QLabel() creates a label object which we can use for our GUI. Passing the window object we created (win) into it’s parameters declares that the label is part of that window
A simple line of code that sets the Text for the label that gets displayed on the window
QLabels have a default size that is declared when they are created. For long lines of text, such as the one we passed into setText(), the default size is too small. Luckily, we just have the call a single method adjustSize() will cause the QLabel to automatically adjust it’s size. Not doing this will result in the text only appearing partially on the screen.
This line determines the starting position of the QLabel when it appears on the screen. Passing (100, 100) will result in the top left hand corner of the label appearing at coordinates (100 , 100). Keep in mind that the top left hand corner of the screen has the position (0, 0).

move() is a very basic layout system, and not suitable for actual projects. PyQt5 comes with actual layouts, in charge of managing positions of the widgets inside the window. Learn more about them in our PyQt5 layout management tutorial.
github link : https://github.com/reve23/pyat5.git
This is a small session in the next session we are going to take a look at the methods are available in in qlabel.

Thanks for watching i will see you in the nextlesson.