May 2019
Intermediate to advanced
542 pages
13h 37m
English
The QLineEdit class is a single-line text-entry widget that you might commonly use in a data-entry or login form. QLineEdit can be called with no arguments, with only a parent widget, or with a default string value as the first argument, like so:
line_edit = qtw.QLineEdit('default value', self)
There are also a number of properties we can pass in:
| Property | Arguments | Description |
|---|---|---|
| text | string | The contents of the box. |
| readOnly | Boolean | Whether the field can be edited. |
| clearButtonEnabled | Boolean | Whether a clear button is added. |
| placeholderText | string | Text that will appear when the field is empty. |
| maxLength | integer | The maximum number of characters that can be entered. |
| echoMode | QLineEdit.EchoMode | Switches the way text ... |
Read now
Unlock full access