

This property holds the movement style of cursor in this line edit. Pastes the clipboard text into line edit.ĭeletes the selected text and copies it to the clipboard.Īny other key sequence that represents a valid character, will cause the character to be inserted into the line edit.ĬursorBackward(). Moves the cursor to the beginning of the line.ĭeletes the character to the left of the cursor.ĭeletes the word to the left of the cursor.ĭeletes the character to the right of the cursor.ĭeletes the word to the right of the cursor.Ĭopies the selected text to the clipboard. Moves and selects text one character to the right. Moves the cursor one character to the right.

Moves and selects text one character to the left. Moves the cursor one character to the left. The line edit also provides a context menu (usually invoked by a right mouse click) that presents some of these editing options. The default key bindings are described below. īy default, QLineEdits have a frame as specified by platform style guides you can turn it off by calling setFrame (false). Note that if there is a validator set on the line edit, the returnPressed() / editingFinished() signals will only be emitted if the validator returns Acceptable. When editing is finished, either because the line edit lost focus or Return/Enter is pressed the editingFinished() signal is emitted. 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(). Def inputMethodQuery (property, argument)ĭef setTextMargins (left, top, right, 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.
