28
Creates a simple plasma theme based text field.
28
Creates a simple plasma theme based text field widget.
33
Sets the font for the text area.
38
If it is true then the problematic lines will be highlighted.
41
Returns the cursor's position.
44
If this property is set to true the text cannot be edited by user interaction.
47
This read-only property provides the text currently selected in the text edit.
50
The cursor position after the last character in the current selection.
51
This property is read-only.
54
The cursor position before the first character in the current selection.
55
This property is read-only.
60
string placeholderText:TODO
63
Specifies how the text should be displayed in the TextInput.
65
TextInput.Normal - Displays the text as it is. (Default)
66
TextInput.Password - Displays asterixes instead of characters.
67
TextInput.NoEcho - Displays nothing.
68
TextInput.PasswordEchoOnEdit - Displays all but the current character as asterixes.
71
Allows you to set a validator on the TextInput. When a validator is set the TextInput
72
will only accept input which leaves the text property in an acceptable or intermediate state.
73
The accepted signal will only be sent if the text is in an acceptable state when enter is pressed.
74
Currently supported validators are IntValidator, DoubleValidator and RegExpValidator.
75
An example of using validators is shown below, which allows input of integers
76
between 11 and 31 into the text input:
80
validator: IntValidator{bottom: 11; top: 31;}
86
Sets the maximum length that the string can have.
88
alias acceptableInput:
89
This property is always true unless a validator has been set. If a validator has been set,
90
this property will only be true if the current text is acceptable to the validator as a final string
91
(not as an intermediate string)
94
This property indicates whether the item has active focus.
95
An item with active focus will receive keyboard input.
32
This property holds the font used in the text field.
33
The default font value is the font from plasma desktop theme.
35
* Qt::InputMethodHints inputMethodHints:
36
This property holds the the currently supported input method hints
38
The default values is Qt.ImhNone.
40
* bool errorHighlight:
41
This property holds if the text field is highlighted or not
42
If it is true then the problematic lines will be highlighted.
43
This feature is defined in the Common API but is unimplemented in plasma components.
46
This property holds the current cursor position.
49
This property holds if the text field can be modified by the user interaction.
50
The default value is false.
52
* string selectedText:
53
This property holds the text selected by the user.
54
If no text is selected it holds an empty string.
55
This property is read-only.
58
This property holds the cursor position after the last character in the current selection.
59
This property is read-only.
62
This property holds the cursor position before the first character in the current selection.
63
This property is read-only.
66
This property holds the entire text in the text field.
68
* string placeholderText:
69
This property holds the text displayed in when the text is empty.
70
The default value is empty string, meaning no placeholderText shown.
72
* enumeration echoMode:
73
This property specifies how the text should be displayed in the TextField.
74
The acceptable values are:
75
- TextInput.Normal - Displays the text as it is. (Default)
76
- TextInput.Password - Displays asterixes instead of characters.
77
- TextInput.NoEcho - Displays nothing.
78
- TextInput.PasswordEchoOnEdit - Displays all but the current character as asterixes.
79
The default value is TextInput.Normal
82
Allows you to set an input mask on the TextField, restricting the allowable text inputs.
83
See QLineEdit::inputMask for further details, as the exact same mask strings are used by TextInput.
85
* Validator validator:
86
Allows you to set a validator on the TextField. When a validator is set the TextField
87
will only accept input which leaves the text property in an acceptable or intermediate state.
88
The accepted signal will only be sent if the text is in an acceptable state when enter is pressed.
89
Currently supported validators are IntValidator, DoubleValidator and RegExpValidator.
90
An example of using validators is shown below, which allows input of integers
91
between 11 and 31 into the text input:
95
validator: IntValidator { bottom: 11; top: 31 }
101
The maximum permitted length of the text in the TextField.
102
If the text is too long, it is truncated at the limit.
103
By default, this property contains a value of 32767.
105
* bool acceptableInput:
106
This property is always true unless a validator or input mask has been set.
107
If a validator or input mask has been set, this property will only be true if the current
108
text is acceptable to the validator or input mask as a final string (not as an intermediate string).
109
This property is always true unless a validator has been set.
110
If a validator has been set, this property will only be true if the current text is acceptable to the
111
validator as a final string (not as an intermediate string).
112
This property is read-only.
114
* bool clearButtonShown:
115
Holds if the button to clear the text from TextField is visible.
118
This signal is emitted when the text input is accepted.
122
Copies the currently selected text to the system clipboard.
125
Moves the currently selected text to the system clipboard.
128
Removes active text selection.
131
Replaces the currently selected text by the contents of the system clipboard.
133
* void select(int start, int end):
134
Causes the text from start to end to be selected.
135
If either start or end is out of range, the selection is not changed.
136
After calling this, selectionStart will become the lesser and selectionEnd will become the greater
137
(regardless of the order passed to this method).
140
Causes all text to be selected.
143
Causes the word closest to the current cursor position to be selected.
145
* void positionAt(int position):
146
This function returns the character position at x pixels from the left of the TextField.
147
Position 0 is before the first character, position 1 is after the first character but before the second,
148
and so on until position text.length, which is after all characters.
149
This means that for all x values before the first character this function returns 0,
150
and for all x values after the last character this function returns text.length.
152
* rectangle positionToRectangle(position):
153
Returns the rectangle at the given position in the text.
154
The x, y, and height properties correspond to the cursor that would describe that position.
98
157
import QtQuick 1.1
99
158
import org.kde.plasma.core 0.1 as PlasmaCore
159
import "private" as Private