TextEditor
#include <bb/cascades/TextEditor>
Use for text selection and editing.
BlackBerry 10.0.0
QML properties
| selectedText | : QString [read-only] |
| cursorPosition | : int |
| selectionStart | : int [read-only] |
| selectionEnd | : int [read-only] |
QML signals
Properties Index
| QString | selectedText [read-only] |
| int | cursorPosition |
| int | selectionStart [read-only] |
| int | selectionEnd [read-only] |
Public Functions Index
| QString | selectedText () const |
| int | cursorPosition () const |
| int | selectionStart () const |
| int | selectionEnd () const |
| Q_INVOKABLE void | insertPlainText (QString text) |
| Q_INVOKABLE void | setSelection (int start, int end) |
| void | setCursorPosition (int cursorPosition) |
| void | resetCursorPosition () |
Signals Index
| void | selectedTextChanged (QString selectedText) |
| void | cursorPositionChanged (int cursorPosition) |
| void | selectionStartChanged (int selectionStart) |
| void | selectionEndChanged (int selectionEnd) |
Properties
QString
Currently selected text.
The currently seleced text in plain text format.
BlackBerry 10.0.0
int
The cursor position.
The default value is 0. Setting a value less then zero or beyond the end of the document will result in clamping. Setting the cursor position will reset the current selection.
BlackBerry 10.0.0
int
The position of the start of the selection range.
The default value is 0. Setting a value less then zero or beyond the end of the document will result in clamping.
BlackBerry 10.0.0
int
The position of the end of the selection range.
The default value is 0. Setting a value less then zero or beyond the end of the document will result in clamping.
BlackBerry 10.0.0
Public Functions
QString
Returns the currently selected text.
The currently selected text in plain text.
BlackBerry 10.0.0
int
The cursor position.
The default value is 0.
BlackBerry 10.0.0
int
The start of the selection range.
The default value is 0.
BlackBerry 10.0.0
int
The end of the selection range.
The default value is 0.
BlackBerry 10.0.0
Q_INVOKABLE void
Insert text at the current position.
Inserts unformatted text at the current position, replaces any selection. The text will be formatted according to the format at the insertion point.
| Parameters | |
|---|---|
| text |
The text to insert |
BlackBerry 10.0.0
Q_INVOKABLE void
Set the selection.
Set the selection between start and end and places the cursor at the end position. Setting end < start will result in undefined behaviour.
| Parameters | |
|---|---|
| start |
Start position of selection Values less then zero or beyond the end of the document length will be clamped. |
| end |
End position of selection Values less then zero or beyond the end of the document length will be clamped. |
BlackBerry 10.0.0
void
Set the cursor position.
| Parameters | |
|---|---|
| cursorPosition |
The new cursor position Values less then zero or beyond the end of the document length will be clamped. |
BlackBerry 10.0.0
void
Resets the cursor position to its default value of 0.
BlackBerry 10.0.0
Signals
void
Emitted when the selected text has changed.
| Parameters | |
|---|---|
| selectedText |
The new selected text. |
BlackBerry 10.0.0
void
Emitted when the cursor position has changed.
| Parameters | |
|---|---|
| cursorPosition |
The new cursor position. |
BlackBerry 10.0.0
void
Emitted when the start of the selection range has changed.
| Parameters | |
|---|---|
| selectionStart |
The new start of the selection. |
BlackBerry 10.0.0
void
Emitted when the end of the selection range has changed.
| Parameters | |
|---|---|
| selectionEnd |
The new end of the selection. |
BlackBerry 10.0.0