2024-07-11
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
QLineEdit is used to represent a single-line input box, where you can enter a paragraph of text but cannot wrap.
Core Attributes:
Attributes | illustrate |
---|---|
text | Text in the input box |
inputMask | Input content format constraints |
maxLength | The maximum length |
frame | Whether to add a border |
echoMode | Display mode: 1. QLineEdit::Normal: This is the default value, the text box will display the entered text. 2. QLineEdit::Password: In this mode, the entered characters will be hidden, usually replaced by (*) or (=) 3. QLineEdit::NoEcho: In this mode, the text box will not echo any entered characters |
cursorPosition | Cursor location |
alignment | Text alignment, set horizontal and vertical alignment |
dragEnabled | Is dragging allowed? |
readOnly | Is it read-only (modification is not allowed) |
placeHolderText | When the input box is empty, what kind of prompt message is displayed |
clearButtonEnabled | Whether the "clear button" will be automatically displayed |
Core signal:
Signal | illustrate |
---|---|
void cursorPositionChanged(int old, int new) | When the mouse moves, a signal is emitted, old is the previous position, and new is the new position |
void editingFinished() | This signal is emitted when the Back or Enter key is pressed, or when the line edit loses focus. |
void returnPressed() | This signal is triggered when the return or enter key is pressed. If a validator is set, it must pass the validation to be triggered. |
void selectionChanged() | This signal is emitted when the selected text changes. |
void textChanged(const QString |