diff options
Diffstat (limited to 'src/declarative/fx/qfxtextedit.cpp')
-rw-r--r-- | src/declarative/fx/qfxtextedit.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 7f08fba..7162bdf 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -179,7 +179,7 @@ void QFxTextEdit::setText(const QString &text) Supported text formats are \c AutoText, \c PlainText and \c RichText. The default is AutoText. If the text format is AutoText the text edit - edit will automatically determine whether the text should be treated as + will automatically determine whether the text should be treated as rich text. This determination is made using Qt::mightBeRichText(). \table @@ -410,7 +410,7 @@ void QFxTextEdit::setWrap(bool w) } /*! - \property QFxTextEdit::cursorVisible + \qmlproperty TextEdit::cursorVisible \brief If true the text edit shows a cursor. This property is set and unset when the text edit gets focus, but it can also @@ -435,6 +435,25 @@ void QFxTextEdit::setCursorVisible(bool on) } /*! + \qmlproperty TextEdit::cursorPosition + \brief The position of the cursor in the TextEdit. +*/ +int QFxTextEdit::cursorPosition() const +{ + Q_D(const QFxTextEdit); + return d->control->textCursor().position(); +} + +void QFxTextEdit::setCursorPosition(int pos) +{ + Q_D(QFxTextEdit); + QTextCursor cursor = d->control->textCursor(); + if (cursor.position() == pos) + return; + cursor.setPosition(pos); +} + +/*! \qmlproperty bool TextEdit::focusOnPress Whether the TextEdit should gain focus on a mouse press. By default this is |