PlasmaComponents

Public Member Functions | |
void | copy () |
void | cut () |
void | forceActiveFocus () |
void | paste () |
void | positionAt (pos) |
rectangle | positionToRectangle (int pos) |
void | select (int start, int end) |
void | selectAll () |
void | selectWord () |
Properties | |
alias | activeFocus |
int | contentMaxHeight |
int | contentMaxWidth |
int | cursorPosition |
bool | errorHighlight |
font | font |
enum | horizontalAlignment |
int | inputMethodHints |
bool | interactive |
string | placeholderText |
bool | readOnly |
string | selectedText |
int | selectionEnd |
int | selectionStart |
string | text |
enum | textFormat |
enum | verticalAlignment |
enum | wrapMode |
Detailed Description
Member Function Documentation
void TextArea::copy | ( | ) |
Copies the currently selected text to the system clipboard.
void TextArea::cut | ( | ) |
Moves the currently selected text to the system clipboard.
void TextArea::forceActiveFocus | ( | ) |
void TextArea::paste | ( | ) |
Replaces the currently selected text by the contents of the system clipboard.
void TextArea::positionAt | ( | pos | ) |
This function returns the character position at x pixels from the left of the TextArea.
Position 0 is before the first character, position 1 is after the first character but before the second, and so on until position text.length, which is after all characters. This means that for all x values before the first character this function returns 0, and for all x values after the last character this function returns text.length.
- Parameters
-
type:int pos x-coordinate we are interested in.
- Returns
- type:int the character position
rectangle TextArea::positionToRectangle | ( | int | pos | ) |
Returns the rectangle at the given position in the text.
The x, y, and height properties correspond to the cursor that would describe that position.
- Parameters
-
pos the text position
- Returns
- the cursor rectangle
void TextArea::select | ( | int | start, |
int | end | ||
) |
Causes the text from start to end to be selected.
If either start or end is out of range, the selection is not changed. After calling this, selectionStart will become the lesser and selectionEnd will become the greater (regardless of the order passed to this method).
- Parameters
-
start Start of selection end End of selection
void TextArea::selectAll | ( | ) |
Causes all text to be selected.
void TextArea::selectWord | ( | ) |
Causes the word closest to the current cursor position to be selected.
Property Documentation
alias TextArea::activeFocus |
Definition at line 245 of file TextArea.qml.
int TextArea::contentMaxHeight |
Maximum height that the text content can have.
Definition at line 240 of file TextArea.qml.
int TextArea::contentMaxWidth |
Maximum width that the text content can have.
Definition at line 235 of file TextArea.qml.
int TextArea::cursorPosition |
Current cursor position.
Definition at line 53 of file TextArea.qml.
bool TextArea::errorHighlight |
Whether the text field is highlighted or not.
If it is true then the problematic lines will be highlighted.
- Warning
- unimplemented in plasma components.
Definition at line 48 of file TextArea.qml.
font TextArea::font |
Font used in the text field.
The default font value is the font from plasma desktop theme.
Definition at line 34 of file TextArea.qml.
enum TextArea::horizontalAlignment |
Sets the horizontal alignment of the text within the TextArea item's width and height.
By default, the text alignment follows the natural alignment of the text, for example text that is read from left to right will be aligned to the left.
Valid values:
- TextEdit.AlignLeft (default)
- TextEdit.AlignRight
- TextEdit.AlignHCenter
- TextEdit.AlignJustify
Definition at line 70 of file TextArea.qml.
int TextArea::inputMethodHints |
The currently supported input method hints for the text field.
The default values is Qt.ImhNone.
Definition at line 40 of file TextArea.qml.
bool TextArea::interactive |
This property describes whether the user can interact with the TextArea flicking content.
A user cannot drag or flick a TextArea that is not interactive. This property is useful for temporarily disabling flicking.
Definition at line 230 of file TextArea.qml.
string TextArea::placeholderText |
The text displayed when the text property is empty.
The default value is an empty string, meaning no placeholderText shown.
Definition at line 161 of file TextArea.qml.
bool TextArea::readOnly |
Whether the TextArea is in read-only mode, and cannot be modified by the user.
The default value is false.
Definition at line 90 of file TextArea.qml.
string TextArea::selectedText |
The text selected by the user.
If no text is selected it holds an empty string.
This property is read-only.
Definition at line 98 of file TextArea.qml.
int TextArea::selectionEnd |
The cursor position after the last character in the current selection.
This property is read-only.
Definition at line 105 of file TextArea.qml.
int TextArea::selectionStart |
The cursor position before the first character in the current selection.
This property is read-only.
Definition at line 112 of file TextArea.qml.
string TextArea::text |
The text in the TextArea.
Definition at line 117 of file TextArea.qml.
enum TextArea::textFormat |
The way the text property should be displayed.
Valid values:
- TextEdit.AutoText
- TextEdit.PlainText
- TextEdit.RichText
- TextEdit.StyledText
The default is TextEdit.AutoText. If the text format is TextEdit.AutoText the text edit will automatically determine whether the text should be treated as rich text. This determination is made using Qt::mightBeRichText().
Definition at line 134 of file TextArea.qml.
enum TextArea::verticalAlignment |
Sets the vertical alignment of the text within the TextArea item's width and height.
Valid values:
- TextEdit.AlignTop (default)
- TextEdit.AlignBottom
- TextEdit.AlignVCenter
Definition at line 82 of file TextArea.qml.
enum TextArea::wrapMode |
Set this property to wrap the text to the TextArea item's width.
The text will only wrap if an explicit width has been set.
Valid values:
- TextEdit.NoWrap: no wrapping will be performed. If the text contains insufficient newlines, then implicitWidth will exceed a set width.
- TextEdit.WordWrap: wrapping is done on word boundaries only. If a word is too long, implicitWidth will exceed a set width.
- TextEdit.WrapAnywhere: wrapping is done at any point on a line, even if it occurs in the middle of a word.
- TextEdit.Wrap: if possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.
The default is TextEdit.NoWrap. If you set a width, consider using TextEdit.Wrap.
Definition at line 155 of file TextArea.qml.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.