summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetextedit.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-12-20 23:00:16 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-12-20 23:00:16 (GMT)
commitad23f356e503536b34ea8e59aa3390459d1bbfea (patch)
treed4d2dd72b32b1b83ab9ae967af21609f11e46a46 /src/declarative/graphicsitems/qdeclarativetextedit.cpp
parent8bea6ea27ff47ff2a02cb6e8ef5b16b3a7d0f0d5 (diff)
parent987a683ff51997cb23cb931af99c6554651742d7 (diff)
downloadQt-ad23f356e503536b34ea8e59aa3390459d1bbfea.zip
Qt-ad23f356e503536b34ea8e59aa3390459d1bbfea.tar.gz
Qt-ad23f356e503536b34ea8e59aa3390459d1bbfea.tar.bz2
Merge branch '4.7-upstream' into 4.7-water
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextedit.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index e05f4e4..4e16d24 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -643,6 +643,8 @@ int QDeclarativeTextEdit::cursorPosition() const
void QDeclarativeTextEdit::setCursorPosition(int pos)
{
Q_D(QDeclarativeTextEdit);
+ if (pos < 0 || pos > d->text.length())
+ return;
QTextCursor cursor = d->control->textCursor();
if (cursor.position() == pos)
return;