Struct LineEdit
Control that provides single-line string editing.
struct LineEdit
;
LineEdit provides a single-line string editor, used for text fields.
It features many built-in shortcuts which will always be available (Ctrl
here maps to Command
on macOS):
- Ctrl + C: Copy
- Ctrl + X: Cut
- Ctrl + V or Ctrl + Y: Paste/"yank"
- Ctrl + Z: Undo
- Ctrl + Shift + Z: Redo
- Ctrl + U: Delete text from the cursor position to the beginning of the line
- Ctrl + K: Delete text from the cursor position to the end of the line
- Ctrl + A: Select all text
- Up/Down arrow: Move the cursor to the beginning/end of the line
On macOS, some extra keyboard shortcuts are available:
- Ctrl + F: Like the right arrow key, move the cursor one character right
- Ctrl + B: Like the left arrow key, move the cursor one character left
- Ctrl + P: Like the up arrow key, move the cursor to the previous line
- Ctrl + N: Like the down arrow key, move the cursor to the next line
- Ctrl + D: Like the Delete key, delete the character on the right side of cursor
- Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor
- Command + Left arrow: Like the Home key, move the cursor to the beginning of the line
- Command + Right arrow: Like the End key, move the cursor to the end of the line
Properties
Name | Type | Description |
---|---|---|
_align [get, set]
|
LineEdit | Text alignment as defined in the align enum.
|
caretBlink [get, set]
|
bool | If true , the caret (visual cursor) blinks.
|
caretBlinkSpeed [get, set]
|
double | Duration (in seconds) of a caret's blinking cycle. |
caretPosition [get, set]
|
long | The cursor's position inside the LineEdit . When set, the text may scroll to accommodate it.
|
clearButtonEnabled [get, set]
|
bool | If true , the LineEdit will show a clear button if text is not empty, which can be used to clear the text quickly.
|
contextMenuEnabled [get, set]
|
bool | If true , the context menu will appear when right-clicked.
|
editable [get, set]
|
bool | If false , existing text cannot be modified and new text cannot be added.
|
expandToTextLength [get, set]
|
bool | If true , the LineEdit width will increase to stay longer than the text . It will not compress if the text is shortened.
|
maxLength [get, set]
|
long | Maximum amount of characters that can be entered inside the LineEdit . If 0 , there is no limit.
|
placeholderAlpha [get, set]
|
double | Opacity of the placeholderText . From 0 to 1 .
|
placeholderText [get, set]
|
String | Text shown when the LineEdit is empty. It is not the LineEdit 's default value (see text ).
|
rightIcon [get, set]
|
Texture | Sets the icon that will appear in the right end of the LineEdit if there's no text , or always, if clearButtonEnabled is set to false .
|
secret [get, set]
|
bool | If true , every character is replaced with the secret character (see secretCharacter ).
|
secretCharacter [get, set]
|
String | The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character. |
selectingEnabled [get, set]
|
bool | If false , it's impossible to select the text using mouse nor keyboard.
|
shortcutKeysEnabled [get, set]
|
bool | If false , using shortcuts will be disabled.
|
text [get, set]
|
String | String value of the LineEdit .
Note: Changing text using this property won't emit the textChanged signal.
|
Methods
Enums
Name | Description |
---|---|
Align
|
|
Constants
|
|
MenuItems
|