aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-08-08 20:29:19 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-08-13 15:03:51 +0200
commitfb339b21b8a24b835cea7a057c47b7c5ad80dd72 (patch)
tree5ad9ff6bb107073acc7ae16bfaf7801fd10f7714 /src/quick/items/qquicktextedit.cpp
parent2b3de73defd4fca0888b5c2824c73d4fc26d6f7c (diff)
Create rectangle nodes in the text editing through the context
Unfortunately we can't re-use the QSGSimpleRectNode, as it doesn't provide us with virtual methods to move it's creation into the context. But's since it's only 20 lines of code anyway, this is still a nice cleanup. And it also allows the re-use of any optimizations in the renderer for QSGRectangleNode. Change-Id: I957777fbbeb0a994a9c257baf3bfe87fce8cc9e8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/quick/items/qquicktextedit.cpp')
-rw-r--r--src/quick/items/qquicktextedit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index fdaef6df8e..6bec2ce646 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -155,7 +155,7 @@ namespace {
newNode->setFlag(QSGNode::OwnedByParent);
}
- void resetCursorNode(QSGSimpleRectNode* newNode)
+ void resetCursorNode(QSGRectangleNode* newNode)
{
if (cursorNode)
removeChildNode(cursorNode);
@@ -165,7 +165,7 @@ namespace {
cursorNode->setFlag(QSGNode::OwnedByParent);
}
- QSGSimpleRectNode *cursorNode;
+ QSGRectangleNode *cursorNode;
QQuickTextNode* frameDecorationsNode;
};
@@ -1914,7 +1914,7 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
QColor color = (!d->cursorVisible || !d->control->cursorOn())
? QColor(0, 0, 0, 0)
: d->color;
- rootNode->resetCursorNode(new QSGSimpleRectNode(cursorRectangle(), color));
+ rootNode->resetCursorNode(d->sceneGraphContext()->createRectangleNode(cursorRectangle(), color));
}
return rootNode;