summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetextinput.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-06-16 10:27:53 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-06-16 10:27:53 (GMT)
commit59ec66675b725f56111e4b133e79828bc6d5d95a (patch)
treea0e4f04f62d59fa2aa07c4d9c4102284de5574e9 /src/declarative/graphicsitems/qdeclarativetextinput.cpp
parent50f4129a2664ed72de899f4477b47f91488c04d9 (diff)
downloadQt-59ec66675b725f56111e4b133e79828bc6d5d95a.zip
Qt-59ec66675b725f56111e4b133e79828bc6d5d95a.tar.gz
Qt-59ec66675b725f56111e4b133e79828bc6d5d95a.tar.bz2
Write TextInput.positionToRectangle docs.
Also renamed the argument to be more accurate. Task-number: QTBUG-11168
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextinput.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 033e12c..9e5dfb5 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -845,12 +845,18 @@ void QDeclarativeTextInput::moveCursor()
}
/*!
- \qmlmethod rect TextInput::positionToRectangle(int x)
+ \qmlmethod rect TextInput::positionToRectangle(int pos)
+
+ This function takes a character position and returns the rectangle that the
+ cursor would occupy, if it was placed at that character position.
+
+ This is similar to setting the cursorPosition, and then querying the cursor
+ rectangle, but the cursorPosition is not changed.
*/
-QRectF QDeclarativeTextInput::positionToRectangle(int x) const
+QRectF QDeclarativeTextInput::positionToRectangle(int pos) const
{
Q_D(const QDeclarativeTextInput);
- return QRectF(d->control->cursorToX(x)-d->hscroll,
+ return QRectF(d->control->cursorToX(pos)-d->hscroll,
0.0,
d->control->cursorWidth(),
cursorRectangle().height());