aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgtextnode_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-05-09 12:07:55 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-05-23 13:41:01 +0200
commite430f1336881850a73a54a291e0276160d568212 (patch)
treef90342efb8df19f92aef075d251fbb2787da20dd /src/declarative/items/qsgtextnode_p.h
parent7aed0fc2d0176d82f9ebd10857d3d6fe7b24b026 (diff)
Make QSGTextNode back-end for QML's TextInput
To get the benefit of different glyph node backends, the TextInput item has now been moved over on SceneGraph's TextNode instead of QPainter, and selections and decorations are painted using QSGSimpleRects.
Diffstat (limited to 'src/declarative/items/qsgtextnode_p.h')
-rw-r--r--src/declarative/items/qsgtextnode_p.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/declarative/items/qsgtextnode_p.h b/src/declarative/items/qsgtextnode_p.h
index 7a49f51dbe..ece80bdce0 100644
--- a/src/declarative/items/qsgtextnode_p.h
+++ b/src/declarative/items/qsgtextnode_p.h
@@ -54,6 +54,7 @@ class QColor;
class QTextDocument;
class QSGContext;
class QRawFont;
+class QSGSimpleRectNode;
class QSGTextNode : public QSGTransformNode
{
@@ -65,18 +66,30 @@ public:
void deleteContent();
void addTextLayout(const QPointF &position, QTextLayout *textLayout, const QColor &color = QColor(),
- QSGText::TextStyle style = QSGText::Normal, const QColor &styleColor = QColor());
+ QSGText::TextStyle style = QSGText::Normal, const QColor &styleColor = QColor(),
+ const QColor &selectionColor = QColor(), const QColor &selectedTextColor = QColor(),
+ int selectionStart = -1, int selectionEnd = -1);
void addTextDocument(const QPointF &position, QTextDocument *textDocument, const QColor &color = QColor(),
QSGText::TextStyle style = QSGText::Normal, const QColor &styleColor = QColor());
+ void setCursor(const QRectF &rect, const QColor &color);
+ QSGSimpleRectNode *cursorNode() const { return m_cursorNode; }
+
private:
void addTextBlock(const QPointF &position, QTextDocument *textDocument, const QTextBlock &block,
const QColor &overrideColor, QSGText::TextStyle style = QSGText::Normal, const QColor &styleColor = QColor());
QSGGlyphNode *addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color,
QSGText::TextStyle style = QSGText::Normal, const QColor &styleColor = QColor());
+ QSGGlyphNode *addGlyphsAndDecoration(const QPointF &position, const QGlyphRun &glyphs,
+ const QColor &color,
+ QSGText::TextStyle style = QSGText::Normal,
+ const QColor &styleColor = QColor(),
+ const QPointF &decorationPosition = QPointF());
+
void addTextDecorations(const QPointF &position, const QRawFont &font, const QColor &color,
qreal width, bool hasOverline, bool hasStrikeOut, bool hasUnderline);
QSGContext *m_context;
+ QSGSimpleRectNode *m_cursorNode;
};
QT_END_NAMESPACE