diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-08-08 20:29:19 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-08-13 15:03:51 +0200 |
commit | fb339b21b8a24b835cea7a057c47b7c5ad80dd72 (patch) | |
tree | 5ad9ff6bb107073acc7ae16bfaf7801fd10f7714 /src/quick/items/qquicktextnode_p.h | |
parent | 2b3de73defd4fca0888b5c2824c73d4fc26d6f7c (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/qquicktextnode_p.h')
-rw-r--r-- | src/quick/items/qquicktextnode_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/qquicktextnode_p.h b/src/quick/items/qquicktextnode_p.h index 0bff0d5cff..7099b19c46 100644 --- a/src/quick/items/qquicktextnode_p.h +++ b/src/quick/items/qquicktextnode_p.h @@ -59,7 +59,7 @@ class QColor; class QTextDocument; class QSGContext; class QRawFont; -class QSGSimpleRectNode; +class QSGRectangleNode; class QSGClipNode; class QSGTexture; @@ -96,12 +96,13 @@ public: int selectionStart = -1, int selectionEnd = -1); void setCursor(const QRectF &rect, const QColor &color); - QSGSimpleRectNode *cursorNode() const { return m_cursorNode; } + QSGRectangleNode *cursorNode() const { return m_cursorNode; } QSGGlyphNode *addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color, QQuickText::TextStyle style = QQuickText::Normal, const QColor &styleColor = QColor(), QSGNode *parentNode = 0); void addImage(const QRectF &rect, const QImage &image); + void addRectangleNode(const QRectF &rect, const QColor &color); bool useNativeRenderer() const { return m_useNativeRenderer; } void setUseNativeRenderer(bool on) { m_useNativeRenderer = on; } @@ -110,7 +111,7 @@ private: void initEngine(const QColor &textColor, const QColor &selectedTextColor, const QColor &selectionColor, const QColor& anchorColor = QColor() , const QPointF &position = QPointF()); - QSGSimpleRectNode *m_cursorNode; + QSGRectangleNode *m_cursorNode; QList<QSGTexture *> m_textures; QQuickItem *m_ownerElement; bool m_useNativeRenderer; |