summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-11-09 23:30:06 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-11-09 23:30:06 (GMT)
commit11ac612190b7bd637ede068d2fe8063021a2a0eb (patch)
treee3e7ba6dc681cc9c60dd1672a4c6b3345d85f516 /src/declarative
parent58f8196fceaf375d8a5736e0505330be24bcebfa (diff)
downloadQt-11ac612190b7bd637ede068d2fe8063021a2a0eb.zip
Qt-11ac612190b7bd637ede068d2fe8063021a2a0eb.tar.gz
Qt-11ac612190b7bd637ede068d2fe8063021a2a0eb.tar.bz2
Document TextInput::select(start,end)
Task-number: QTBUG-15162
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 2348478..0deacf8 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -460,10 +460,9 @@ QRect QDeclarativeTextInput::cursorRectangle() const
text edit.
Note that if selectionStart == selectionEnd then there is no current
- selection. If you attempt to set selectionStart to a value outside of
- the current text, selectionStart will not be changed.
+ selection.
- \sa selectionEnd, cursorPosition, selectedText
+ \sa selectionEnd, cursorPosition, selectedText, select()
*/
int QDeclarativeTextInput::selectionStart() const
{
@@ -479,10 +478,9 @@ int QDeclarativeTextInput::selectionStart() const
text edit.
Note that if selectionStart == selectionEnd then there is no current
- selection. If you attempt to set selectionEnd to a value outside of
- the current text, selectionEnd will not be changed.
+ selection.
- \sa selectionStart, cursorPosition, selectedText
+ \sa selectionStart, cursorPosition, selectedText, select()
*/
int QDeclarativeTextInput::selectionEnd() const
{
@@ -490,6 +488,19 @@ int QDeclarativeTextInput::selectionEnd() const
return d->lastSelectionEnd;
}
+/*!
+ \qmlmethod void TextInput::select(int start, int end)
+
+ Causes the text from \a start to \a 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).
+
+ \sa selectionStart, selectionEnd
+*/
void QDeclarativeTextInput::select(int start, int end)
{
Q_D(QDeclarativeTextInput);