![]() When the text changes the textChanged() signal is emitted when the text changes other than by calling setText() the textEdited() signal is emitted when the cursor is moved the cursorPositionChanged() signal is emitted and when the Return or Enter key is pressed the returnPressed() signal is emitted. The text can be aligned with setAlignment(). Text can be selected with setSelection() or selectAll(), and the selection can be cut(), copy()ied and paste()d. The text is retrieved with text() the displayed text (which may be different, see EchoMode) is retrieved with displayText(). You can change the text with setText() or insert(). When switching between a validator and an input mask on the same line edit, it is best to clear the validator or input mask to prevent undefined behavior.Ī related class is QTextEdit which allows multi-line, rich text editing. The text can be arbitrarily constrained using a validator() or an inputMask(), or both. The length of the text can be constrained to maxLength(). SetTextMargins(int left, int top, int right, int bottom)Ī line edit allows the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop (see setDragEnabled()).īy changing the echoMode() of a line edit, it can also be used as a "write-only" field, for inputs such as passwords. SetCursorMoveStyle(Qt::CursorMoveStyle style) QLineEdit(const QString & contents, QWidget * parent = nullptr)ĪddAction(QAction * action, QLineEdit::ActionPosition position)ĪddAction(const QIcon & icon, QLineEdit::ActionPosition position)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |