What We Know About QLineEdit - russ-hensel/qt5_by_example GitHub Wiki
A line edit or QLineEdit is a more or less rectangular area on a GUI that typically:
- has space for user input and is use for that
- is a single line
It is a lot like a QPushButton, but that widget is normally for clicking, or QLable which is normally for single line text display but not input. If you want to be clever you can sometimes substitute one for the other, but this is usually a bad idea.
Now we will look deeper into the topic of QLineEdits, and talk a bit about how buttons share many features with many other widgets.
After a widget is created we can change may of its characteristics ( and some of these can also be set up in its init, but changing at a later runtime is more general )
These characteristics are part of the widgets state. Some related to appearance. For example:
- size
- font
- colors
Others are related to user actions the widget can detect and act on
- return pressed
- get focus
Different widget may have different appearance and action states, depending on their intended use.
You can find the code at: https://github.com/russ-hensel/qt5_by_example/blob/main/tabs/basic_widgets/tab_q_push_button.py but is better viewed in your own IDE.
Interaction to try on this tab:
- enter and edit text
- hover look for tool tips
- poke around -- do not forget to look at the gui
To see and change the state use the mutate/examine button and read the code in the mutate_x methods.
the documentation is in the code. Coverage is not complete, work continues.
You can use the wat-inspect to find out more or dive into the documentation which is all over the web.