pub struct LineEdit<'a> { /* private fields */ }
Expand description
Notice these docs are heavy WIP and not very relevent yet
A 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())..)
By changing the echoMode() of a line edit, it can also be used as a field, for inputs such as passwords.
The length of the text can be constrained to maxLength(). The text can be arbitrarily constrained using a validator() or an inputMask(), or both. 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.
A related class is QTextEdit which allows multi-line, rich text editing.
You can change the text with setText() or insert(). The text is retrieved with text(); the displayed text (which may be different, see EchoMode ) is retrieved with displayText(). Text can be selected with setSelection() or selectAll(), and the selection can be cut(), copy()ied and paste()d. The text can be aligned with setAlignment().
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.
When editing is finished, either because the line edit lost focus or Return/Enter is pressed the editingFinished() signal is emitted.
Note that if there is a validator set on the line edit, the returnPressed()/editingFinished() signals will only be emitted if the validator returns QValidator::Acceptable.
By default, QLineEdits have a frame as specified by platform style guides; you can turn it off by calling setFrame(false).
The default key bindings are described below. The line edit also provides a context menu (usually invoked by a right mouse click) that presents some of these editing options.
- Keypress
- Action
- Left Arrow
- Moves the cursor one character to the left.
- Shift+Left Arrow
- Moves and selects text one character to the left.
- Right Arrow
- Moves the cursor one character to the right.
- Shift+Right Arrow
- Moves and selects text one character to the right.
- Home
- Moves the cursor to the beginning of the line.
- End
- Moves the cursor to the end of the line.
- Backspace
- Deletes the character to the left of the cursor.
- Ctrl+Backspace
- Deletes the word to the left of the cursor.
- Delete
- Deletes the character to the right of the cursor.
- Ctrl+Delete
- Deletes the word to the right of the cursor.
- Ctrl+A
- Select all.
- Ctrl+C
- Copies the selected text to the clipboard.
- Ctrl+Insert
- Copies the selected text to the clipboard.
- Ctrl+K
- Deletes to the end of the line.
- Ctrl+V
- Pastes the clipboard text into line edit.
- Shift+Insert
- Pastes the clipboard text into line edit.
- Ctrl+X
- Deletes the selected text and copies it to the clipboard.
- Shift+Delete
- Deletes the selected text and copies it to the clipboard.
- Ctrl+Z
- Undoes the last operation.
- Ctrl+Y
- Redoes the last undone operation.
Any other key sequence that represents a valid character, will cause the character to be inserted into the line edit.
See also: [TextEdit
]
[Label
]
[ComboBox
]
{fowler}{GUI Design Handbook: Field
Entry}
{Line Edits Example}
Licence
The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Implementations
sourceimpl<'a> LineEdit<'a>
impl<'a> LineEdit<'a>
pub fn new() -> LineEdit<'a>
sourcepub fn text(&self) -> String
pub fn text(&self) -> String
This signal is emitted whenever the text changes. The text argument is the new text.
Unlike textEdited(), this signal is also emitted when the text is changed programmatically, for example, by calling setText().
This signal is emitted whenever the text is edited. The text argument is the new text.
Unlike textChanged(), this signal is not emitted when the text is changed programmatically, for example, by calling setText().
Setting this property clears the selection, clears the undo/redo history, moves the cursor to the end of the line and resets the modified property to false. The text is not validated when inserted with setText().
The text is truncated to maxLength() length.
By default, this property contains an empty string.
See also: [insert()
]
[clear()
]
Returns the widget’s text margins.
See also: [set_text_margins()
]
sourcepub fn display_text(&self) -> String
pub fn display_text(&self) -> String
If echoMode is Normal this returns the same as text(); if EchoMode is Password or PasswordEchoOnEdit it returns a string of platform-dependent password mask characters text().length() in size, e.g. ; if EchoMode is NoEcho returns an empty string, .
By default, this property contains an empty string.
See also: [set_echo_mode()
]
[text()
]
EchoMode
sourcepub fn placeholder_text(&self) -> String
pub fn placeholder_text(&self) -> String
Setting this property makes the line edit display a grayed-out placeholder text as long as the line edit is empty.
Normally, an empty line edit shows the placeholder text even when it has focus. However, if the content is horizontally centered, the placeholder text is not displayed under the cursor when the line edit has focus.
By default, this property contains an empty string.
See also: [text()
]
pub fn set_placeholder_text(&self, arg0: &str) -> &Self
sourcepub fn max_length(&self) -> i32
pub fn max_length(&self) -> i32
If the text is too long, it is truncated at the limit.
If truncation occurs any selected text will be unselected, the cursor position is set to 0 and the first part of the string is shown.
If the line edit has an input mask, the mask defines the maximum string length.
By default, this property contains a value of 32767.
See also: inputMask
pub fn set_max_length(&self, arg0: i32) -> &Self
pub fn set_frame(&self, arg0: bool) -> &Self
pub fn has_frame(&self) -> bool
sourcepub fn echo_mode(&self) -> EchoMode
pub fn echo_mode(&self) -> EchoMode
The echo mode determines how the text entered in the line edit is displayed (or echoed) to the user.
The most common setting is Normal, in which the text entered by the user is displayed verbatim, but QLineEdit also supports modes that allow the entered text to be suppressed or obscured: these include NoEcho,
Password and PasswordEchoOnEdit.
The widget’s display and the ability to copy or drag the text is affected by this setting.
By default, this property is set to Normal.
See also: EchoMode
[display_text()
]
pub fn set_echo_mode(&self, arg0: EchoMode) -> &Self
pub fn is_read_only(&self) -> bool
pub fn set_read_only(&self, arg0: bool) -> &Self
sourcepub fn cursor_position(&self) -> i32
pub fn cursor_position(&self) -> i32
This signal is emitted whenever the cursor moves. The previous position is given by oldPos, and the new position by newPos.
See also: [set_cursor_position()
]
[cursor_position()
]
Setting the cursor position causes a repaint when appropriate.
By default, this property contains a value of 0.
Returns the cursor position under the point pos.
pub fn set_cursor_position(&self, arg0: i32) -> &Self
sourcepub fn cursor_position_at<P: PointTrait<'a>>(&self, pos: &P) -> i32
pub fn cursor_position_at<P: PointTrait<'a>>(&self, pos: &P) -> i32
Returns the cursor position under the point pos.
pub fn set_alignment(&self, flag: Alignment) -> &Self
sourcepub fn alignment(&self) -> Alignment
pub fn alignment(&self) -> Alignment
Both horizontal and vertical alignment is allowed here, Qt::AlignJustify will map to Qt::AlignLeft.
By default, this property contains a combination of Qt::AlignLeft and Qt::AlignVCenter.
See also: [t::alignment()
]
sourcepub fn cursor_forward(&self, mark: bool, steps: i32) -> &Self
pub fn cursor_forward(&self, mark: bool, steps: i32) -> &Self
Moves the cursor forward steps characters. If mark is true each character moved over is added to the selection; if mark is false the selection is cleared.
See also: [cursor_backward()
]
sourcepub fn cursor_backward(&self, mark: bool, steps: i32) -> &Self
pub fn cursor_backward(&self, mark: bool, steps: i32) -> &Self
Moves the cursor back steps characters. If mark is true each character moved over is added to the selection; if mark is false the selection is cleared.
See also: [cursor_forward()
]
sourcepub fn cursor_word_forward(&self, mark: bool) -> &Self
pub fn cursor_word_forward(&self, mark: bool) -> &Self
Moves the cursor one word forward. If mark is true, the word is also selected.
See also: [cursor_word_backward()
]
sourcepub fn cursor_word_backward(&self, mark: bool) -> &Self
pub fn cursor_word_backward(&self, mark: bool) -> &Self
Moves the cursor one word backward. If mark is true, the word is also selected.
See also: [cursor_word_forward()
]
sourcepub fn backspace(&self) -> &Self
pub fn backspace(&self) -> &Self
If no text is selected, deletes the character to the left of the text cursor and moves the cursor one position to the left. If any text is selected, the cursor is moved to the beginning of the selected text and the selected text is deleted.
See also: [del()
]
sourcepub fn del(&self) -> &Self
pub fn del(&self) -> &Self
If no text is selected, deletes the character to the right of the text cursor. If any text is selected, the cursor is moved to the beginning of the selected text and the selected text is deleted.
See also: [backspace()
]
sourcepub fn home(&self, mark: bool) -> &Self
pub fn home(&self, mark: bool) -> &Self
Moves the text cursor to the beginning of the line unless it is already there. If mark is true, text is selected towards the first position; otherwise, any selected text is unselected if the cursor is moved.
See also: [end()
]
sourcepub fn end(&self, mark: bool) -> &Self
pub fn end(&self, mark: bool) -> &Self
Moves the text cursor to the end of the line unless it is already there. If mark is true, text is selected towards the last position; otherwise, any selected text is unselected if the cursor is moved.
See also: [home()
]
pub fn is_modified(&self) -> bool
pub fn set_modified(&self, arg0: bool) -> &Self
sourcepub fn set_selection(&self, arg0: i32, arg1: i32) -> &Self
pub fn set_selection(&self, arg0: i32, arg1: i32) -> &Self
Selects text from position start and for length characters. Negative lengths are allowed.
See also: [deselect()
]
[select_all()
]
[selected_text()
]
sourcepub fn has_selected_text(&self) -> bool
pub fn has_selected_text(&self) -> bool
hasSelectedText() returns true
if some or all of the text has been
selected by the user; otherwise returns false.
By default, this property is false.
See also: [selected_text()
]
sourcepub fn selected_text(&self) -> String
pub fn selected_text(&self) -> String
If there is no selected text this property’s value is an empty string.
By default, this property contains an empty string.
See also: [has_selected_text()
]
sourcepub fn selection_start(&self) -> i32
pub fn selection_start(&self) -> i32
Returns the index of the first selected character in the line edit or -1 if no text is selected.
See also: [selected_text()
]
See also: [selection_end()
]
See also: [selection_length()
]
sourcepub fn selection_end(&self) -> i32
pub fn selection_end(&self) -> i32
Returns the index of the character directly after the selection in the line edit or -1 if no text is selected.
See also: [selected_text()
]
See also: [selection_start()
]
See also: [selection_length()
]
sourcepub fn selection_length(&self) -> i32
pub fn selection_length(&self) -> i32
Returns the length of the selection.
See also: [selected_text()
]
See also: [selection_start()
]
See also: [selection_end()
]
pub fn is_undo_available(&self) -> bool
pub fn is_redo_available(&self) -> bool
pub fn set_drag_enabled(&self, b: bool) -> &Self
sourcepub fn drag_enabled(&self) -> bool
pub fn drag_enabled(&self) -> bool
Dragging is disabled by default.
pub fn set_cursor_move_style(&self, style: CursorMoveStyle) -> &Self
sourcepub fn cursor_move_style(&self) -> CursorMoveStyle
pub fn cursor_move_style(&self) -> CursorMoveStyle
When this property is set to Qt::VisualMoveStyle, the line edit will use visual movement style. Pressing the left arrow key will always cause the cursor to move left, regardless of the text’s writing direction. The same behavior applies to right arrow key.
When the property is Qt::LogicalMoveStyle (the default), within a LTR text block, increase cursor position when pressing left arrow key, decrease cursor position when pressing the right arrow key. If the text block is right to left, the opposite behavior applies.
sourcepub fn input_mask(&self) -> String
pub fn input_mask(&self) -> String
If no mask is set, inputMask() returns an empty string.
Sets the QLineEdit’s validation mask. Validators can be used instead of, or in conjunction with masks; see setValidator().
Unset the mask and return to normal QLineEdit operation by passing an empty string (“”).
The table below shows the characters that can be used in an input mask. A space character, the default character for a blank, is needed for cases where a character is permitted but not required .
- Character
- Meaning
A
- ASCII alphabetic character required. A-Z, a-z.
a
- ASCII alphabetic character permitted but not required.
N
- ASCII alphanumeric character required. A-Z, a-z, 0-9.
n
- ASCII alphanumeric character permitted but not required.
X
- Any character required.
x
- Any character permitted but not required.
9
- ASCII digit required. 0-9.
0
- ASCII digit permitted but not required.
D
- ASCII digit required. 1-9.
d
- ASCII digit permitted but not required (1-9).
#
- ASCII digit or plus/minus sign permitted but not required.
H
- Hexadecimal character required. A-F, a-f, 0-9.
h
- Hexadecimal character permitted but not required.
B
- Binary character required. 0-1.
b
- Binary character permitted but not required.
>
- All following alphabetic characters are uppercased.
<
- All following alphabetic characters are lowercased.
!
- Switch off case conversion.
[ ] {
}- Reserved.
\\
- Use
\\
to escape the special characters listed above to use them as separators.
The mask consists of a string of mask characters and separators, optionally followed by a semicolon and the character used for blanks. The blank characters are always removed from the text after editing.
Examples:
- Mask
- Notes
000.000.000.000;_
- IP address; blanks are
_
. HH:HH:HH:HH:HH:HH;_
- MAC address
0000-00-00
- ISO Date; blanks are
space
>AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#
- License number; blanks are
-
and all (alphabetic) characters are converted to uppercase.
To get range control (e.g., for an IP address) use masks together with validators
See also: maxLength
pub fn set_input_mask(&self, input_mask: &str) -> &Self
pub fn has_acceptable_input(&self) -> bool
sourcepub fn set_text_margins(
&self,
left: i32,
top: i32,
right: i32,
bottom: i32
) -> &Self
pub fn set_text_margins(
&self,
left: i32,
top: i32,
right: i32,
bottom: i32
) -> &Self
Sets the margins around the text inside the frame to have the sizes left, top, right, and bottom.
See also getTextMargins().
Sets the margins around the text inside the frame.
See also textMargins().
sourcepub fn set_text_margins_2<M: MarginsTrait<'a>>(&self, margins: &M) -> &Self
pub fn set_text_margins_2<M: MarginsTrait<'a>>(&self, margins: &M) -> &Self
Sets the margins around the text inside the frame to have the sizes left, top, right, and bottom.
See also getTextMargins().
Sets the margins around the text inside the frame.
See also textMargins().
sourcepub fn text_margins(&self) -> Margins<'_>
pub fn text_margins(&self) -> Margins<'_>
Returns the widget’s text margins.
See also: [set_text_margins()
]
sourcepub fn set_text(&self, arg0: &str) -> &Self
pub fn set_text(&self, arg0: &str) -> &Self
Sets the margins around the text inside the frame to have the sizes left, top, right, and bottom.
See also getTextMargins().
Sets the margins around the text inside the frame.
See also textMargins().
sourcepub fn clear(&self) -> &Self
pub fn clear(&self) -> &Self
If enabled, the line edit displays a trailing clear button when it contains some text, otherwise the line edit does not show a clear button (the default).
See also: [add_action()
]
[remove_action()
]
Clears the contents of the line edit.
See also: [set_text()
]
[insert()
]
sourcepub fn select_all(&self) -> &Self
pub fn select_all(&self) -> &Self
Selects all the text (i.e. highlights it) and moves the cursor to the end. This is useful when a default value has been inserted because if the user types before clicking on the widget, the selected text will be deleted.
See also: [set_selection()
]
[deselect()
]
sourcepub fn undo(&self) -> &Self
pub fn undo(&self) -> &Self
Undo becomes available once the user has modified the text in the line edit.
By default, this property is false.
Undoes the last operation if undo is available . Deselects any current selection, and updates the selection start to the current cursor position.
sourcepub fn redo(&self) -> &Self
pub fn redo(&self) -> &Self
Redo becomes available once the user has performed one or more undo operations on text in the line edit.
By default, this property is false.
Redoes the last operation if redo is available
sourcepub fn cut(&self) -> &Self
pub fn cut(&self) -> &Self
Copies the selected text to the clipboard and deletes it, if there is any, and if echoMode() is Normal.
If the current validator disallows deleting the selected text, cut() will copy without deleting.
See also: [copy()
]
[paste()
]
[set_validator()
]
sourcepub fn copy(&self) -> &Self
pub fn copy(&self) -> &Self
Copies the selected text to the clipboard, if there is any, and if echoMode() is Normal.
See also: [cut()
]
[paste()
]
sourcepub fn deselect(&self) -> &Self
pub fn deselect(&self) -> &Self
Deselects any selected text.
See also: [set_selection()
]
[select_all()
]
sourcepub fn insert(&self, arg0: &str) -> &Self
pub fn insert(&self, arg0: &str) -> &Self
Deletes any selected text, inserts newText, and validates the result. If it is valid, it sets it as the new contents of the line edit.
See also: [set_text()
]
[clear()
]
sourcepub fn set_text_changed_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &str) + 'a,
T: 'a,
pub fn set_text_changed_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &str) + 'a,
T: 'a,
This signal is emitted whenever the text changes. The text argument is the new text.
Unlike textEdited(), this signal is also emitted when the text is changed programmatically, for example, by calling setText().
pub fn set_text_changed_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&str) + 'a,
sourcepub fn set_text_edited_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &str) + 'a,
T: 'a,
pub fn set_text_edited_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &str) + 'a,
T: 'a,
This signal is emitted whenever the text is edited. The text argument is the new text.
Unlike textChanged(), this signal is not emitted when the text is changed programmatically, for example, by calling setText().
pub fn set_text_edited_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&str) + 'a,
sourcepub fn set_cursor_position_changed_event_ud<F, T>(
&self,
data: &'a T,
func: F
) -> &Selfwhere
F: Fn(&T, i32, i32) + 'a,
T: 'a,
pub fn set_cursor_position_changed_event_ud<F, T>(
&self,
data: &'a T,
func: F
) -> &Selfwhere
F: Fn(&T, i32, i32) + 'a,
T: 'a,
This signal is emitted whenever the cursor moves. The previous position is given by oldPos, and the new position by newPos.
See also: [set_cursor_position()
]
[cursor_position()
]
pub fn set_cursor_position_changed_event<F>(&self, func: F) -> &Selfwhere
F: Fn(i32, i32) + 'a,
sourcepub fn set_return_pressed_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T) + 'a,
T: 'a,
pub fn set_return_pressed_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T) + 'a,
T: 'a,
This signal is emitted when the Return or Enter key is pressed. Note that if there is a validator() or inputMask() set on the line edit, the returnPressed() signal will only be emitted if the input follows the inputMask() and the validator() returns QValidator::Acceptable.
pub fn set_return_pressed_event<F>(&self, func: F) -> &Selfwhere
F: Fn() + 'a,
sourcepub fn set_editing_finished_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T) + 'a,
T: 'a,
pub fn set_editing_finished_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T) + 'a,
T: 'a,
This signal is emitted when the Return or Enter key is pressed or the line edit loses focus. Note that if there is a validator() or inputMask() set on the line edit and enter/return is pressed, the editingFinished() signal will only be emitted if the input follows the inputMask() and the validator() returns QValidator::Acceptable.
pub fn set_editing_finished_event<F>(&self, func: F) -> &Selfwhere
F: Fn() + 'a,
sourcepub fn set_selection_changed_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T) + 'a,
T: 'a,
pub fn set_selection_changed_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T) + 'a,
T: 'a,
This signal is emitted whenever the selection changes.
See also: [has_selected_text()
]
[selected_text()
]
pub fn set_selection_changed_event<F>(&self, func: F) -> &Selfwhere
F: Fn() + 'a,
sourcepub fn set_mouse_press_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_press_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_press_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&MouseEvent<'_>) + 'a,
sourcepub fn set_mouse_move_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_move_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_move_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&MouseEvent<'_>) + 'a,
sourcepub fn set_mouse_release_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_release_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_release_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&MouseEvent<'_>) + 'a,
sourcepub fn set_mouse_double_click_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_double_click_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &MouseEvent<'_>) + 'a,
T: 'a,
pub fn set_mouse_double_click_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&MouseEvent<'_>) + 'a,
sourcepub fn set_key_press_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &KeyEvent<'_>) + 'a,
T: 'a,
pub fn set_key_press_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &KeyEvent<'_>) + 'a,
T: 'a,
Converts the given key press event into a line edit action.
If Return or Enter is pressed and the current text is valid (or can be made valid by the validator), the signal returnPressed() is emitted.
The default key bindings are listed in the class’s detailed description.
pub fn set_key_press_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&KeyEvent<'_>) + 'a,
sourcepub fn set_focus_in_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &FocusEvent<'_>) + 'a,
T: 'a,
pub fn set_focus_in_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &FocusEvent<'_>) + 'a,
T: 'a,
pub fn set_focus_in_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&FocusEvent<'_>) + 'a,
sourcepub fn set_focus_out_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &FocusEvent<'_>) + 'a,
T: 'a,
pub fn set_focus_out_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &FocusEvent<'_>) + 'a,
T: 'a,
pub fn set_focus_out_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&FocusEvent<'_>) + 'a,
sourcepub fn set_paint_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &PaintEvent<'_>) + 'a,
T: 'a,
pub fn set_paint_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &PaintEvent<'_>) + 'a,
T: 'a,
pub fn set_paint_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&PaintEvent<'_>) + 'a,
sourcepub fn set_drag_enter_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DragEnterEvent<'_>) + 'a,
T: 'a,
pub fn set_drag_enter_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DragEnterEvent<'_>) + 'a,
T: 'a,
pub fn set_drag_enter_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&DragEnterEvent<'_>) + 'a,
sourcepub fn set_drag_move_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DragMoveEvent<'_>) + 'a,
T: 'a,
pub fn set_drag_move_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DragMoveEvent<'_>) + 'a,
T: 'a,
pub fn set_drag_move_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&DragMoveEvent<'_>) + 'a,
sourcepub fn set_drag_leave_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DragLeaveEvent<'_>) + 'a,
T: 'a,
pub fn set_drag_leave_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DragLeaveEvent<'_>) + 'a,
T: 'a,
pub fn set_drag_leave_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&DragLeaveEvent<'_>) + 'a,
sourcepub fn set_drop_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DropEvent<'_>) + 'a,
T: 'a,
pub fn set_drop_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &DropEvent<'_>) + 'a,
T: 'a,
pub fn set_drop_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&DropEvent<'_>) + 'a,
sourcepub fn set_change_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &Event<'_>) + 'a,
T: 'a,
pub fn set_change_event_ud<F, T>(&self, data: &'a T, func: F) -> &Selfwhere
F: Fn(&T, &Event<'_>) + 'a,
T: 'a,
pub fn set_change_event<F>(&self, func: F) -> &Selfwhere
F: Fn(&Event<'_>) + 'a,
Shows the standard context menu created with createStandardContextMenu().
If you do not want the line edit to have a context menu, you can set its contextMenuPolicy to Qt::NoContextMenu. If you want to customize the context menu, reimplement this function. If you want to extend the standard context menu, reimplement this function, call createStandardContextMenu() and extend the menu returned.
The event parameter is used to obtain the position where the mouse cursor was when the event was generated.
See also: [set_context_menu_policy()
]