Paint TextInput when it is reparented
authorBea Lam <bea.lam@nokia.com>
Thu, 19 Apr 2012 06:56:32 +0000 (16:56 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 20 Apr 2012 04:20:11 +0000 (06:20 +0200)
Wasn't being repainted if it was moved off then back into view as part
of a VisualItemModel with a ListView.

Task-number: QTBUG-24731
Change-Id: I4ba8035709d3e889fb3f0fe82ef0c0523a39ead8
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
src/quick/items/qquicktextinput.cpp

index c69fd50..b21843e 100644 (file)
@@ -1728,7 +1728,7 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
         node = new QQuickTextNode(QQuickItemPrivate::get(this)->sceneGraphContext(), this);
     d->textNode = node;
 
-    if (!d->textLayoutDirty) {
+    if (!d->textLayoutDirty && oldNode != 0) {
         QSGSimpleRectNode *cursorNode = node->cursorNode();
         if (cursorNode != 0 && !isReadOnly()) {
             cursorNode->setRect(cursorRectangle());