summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-03-25 05:28:40 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-03-30 02:57:39 (GMT)
commitb94176e69efc3948696c6774d5a228fc753b5b29 (patch)
tree9be1cca7cb851a5266bf8949e8b0de5e62128b33 /src/declarative/graphicsitems
parent84413a25bc025f099a075387fb6ab8449d9ef217 (diff)
downloadQt-b94176e69efc3948696c6774d5a228fc753b5b29.zip
Qt-b94176e69efc3948696c6774d5a228fc753b5b29.tar.gz
Qt-b94176e69efc3948696c6774d5a228fc753b5b29.tar.bz2
Fix width of TextInput micro focus rectangle.
Remove the padding QLineControl::cursorRect() adds for region updates. QGraphicsView also grew the rectangle by returning the bounding rect of the transformed rectangle which is fixed by using the same transform for QRect as is used for QRectF. Change-Id: I8d8df9dbc6b4250e4e5392871191123a76b304a0 Task-number: QTBUG-18343 Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index af18c90..e1c2107 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -555,8 +555,10 @@ QRect QDeclarativeTextInput::cursorRectangle() const
{
Q_D(const QDeclarativeTextInput);
QRect r = d->control->cursorRect();
- r.setHeight(r.height()-1); // Make consistent with TextEdit (QLineControl inexplicably adds 1)
- r.moveLeft(r.x() - d->hscroll);
+ // Scroll and make consistent with TextEdit
+ // QLineControl inexplicably adds 1 to the height and horizontal padding
+ // for unicode direction markers.
+ r.adjust(5 - d->hscroll, 0, -4 - d->hscroll, -1);
return r;
}