46 QSGInternalTextNode(QSGRenderContext *renderContext);
47 ~QSGInternalTextNode();
49 static bool isComplexRichText(QTextDocument *);
51 void setColor(QColor color) override
56 QColor color()
const override
61 void setTextStyle(TextStyle textStyle) override
63 m_textStyle = textStyle;
66 TextStyle textStyle() override
71 void setStyleColor(QColor styleColor) override
73 m_styleColor = styleColor;
76 QColor styleColor()
const override
81 void setLinkColor(QColor linkColor) override
83 m_linkColor = linkColor;
86 QColor linkColor()
const override
91 void setSelectionColor(QColor selectionColor) override
93 m_selectionColor = selectionColor;
96 QColor selectionColor()
const override
98 return m_selectionColor;
101 void setSelectionTextColor(QColor selectionTextColor) override
103 m_selectionTextColor = selectionTextColor;
106 QColor selectionTextColor()
const override
108 return m_selectionTextColor;
111 void setRenderTypeQuality(
int renderTypeQuality) override
113 m_renderTypeQuality = renderTypeQuality;
115 int renderTypeQuality()
const override
117 return m_renderTypeQuality;
120 void setRenderType(RenderType renderType) override
122 m_renderType = renderType;
125 RenderType renderType()
const override
130 bool containsUnscalableGlyphs()
const
132 return m_containsUnscalableGlyphs;
135 void setFiltering(QSGTexture::Filtering filtering) override
137 m_filtering = filtering;
140 QSGTexture::Filtering filtering()
const override
145 void setViewport(
const QRectF &viewport) override
147 m_viewport = viewport;
150 QRectF viewport()
const override
155 void setDevicePixelRatio(qreal dpr)
157 m_devicePixelRatio = dpr;
160 void setCursor(
const QRectF &rect,
const QColor &color);
163 void addRectangleNode(
const QRectF &rect,
const QColor &color);
164 virtual void addDecorationNode(
const QRectF &rect,
const QColor &color,
165 QTextCharFormat::UnderlineStyle style);
166 void addImage(
const QRectF &rect,
const QImage &image);
167 void clear() override;
168 QSGGlyphNode *addGlyphs(
const QPointF &position,
const QGlyphRun &glyphs,
const QColor &color,
169 QQuickText::TextStyle style = QQuickText::Normal,
const QColor &styleColor = QColor(),
170 QSGNode *parentNode = 0);
172 QSGInternalRectangleNode *cursorNode()
const {
return m_cursorNode; }
173 std::pair<
int,
int> renderedLineRange()
const {
return { m_firstLineInViewport, m_firstLinePastViewport }; }
176 void doAddTextLayout(QPointF position,
177 QTextLayout *textLayout,
181 int lineCount) override;
183 void doAddTextDocument(QPointF position,
184 QTextDocument *textDocument,
186 int selectionEnd) override;
189 QSGInternalRectangleNode *m_cursorNode =
nullptr;
190 QList<QSGTexture *> m_textures;
191 QSGRenderContext *m_renderContext =
nullptr;
192 RenderType m_renderType = QtRendering;
193 TextStyle m_textStyle = Normal;
195 QColor m_color = QColor(0, 0, 0);
196 QColor m_styleColor = QColor(0, 0, 0);
197 QColor m_linkColor = QColor(0, 0, 255);
198 QColor m_selectionColor = QColor(0, 0, 128);
199 QColor m_selectionTextColor = QColor(255, 255, 255);
200 QSGTexture::Filtering m_filtering = QSGTexture::Nearest;
201 int m_renderTypeQuality = -1;
202 int m_firstLineInViewport = -1;
203 int m_firstLinePastViewport = -1;
204 bool m_containsUnscalableGlyphs =
false;
205 qreal m_devicePixelRatio = 1.0;
207 friend class QQuickTextEdit;
208 friend class QQuickTextEditPrivate;
#define QQUICKTEXT_LARGETEXT_THRESHOLD
static void getLinks_helper(const QTextLayout *layout, QList< QQuickTextPrivate::LinkDesc > *links)