imageCacheDirty(true), updateOnComponentComplete(true),
richText(false), singleline(false), cacheAllTextAsImage(true), internalWidthUpdate(false),
requireImplicitWidth(false), truncated(false), hAlignImplicit(true), rightToLeftText(false),
- layoutTextElided(false), naturalWidth(0), doc(0), layoutThread(0), nodeType(NodeIsNull)
+ layoutTextElided(false), richTextAsImage(false), naturalWidth(0), doc(0), layoutThread(0),
+ nodeType(NodeIsNull)
{
cacheAllTextAsImage = enableImageCache();
}
{
Q_Q(QSGText);
- if(cacheAllTextAsImage || (!QSGDistanceFieldGlyphCache::distanceFieldEnabled() && style != QSGText::Normal)){//If actually using the image cache
+ if(richTextAsImage || cacheAllTextAsImage || (!QSGDistanceFieldGlyphCache::distanceFieldEnabled() && style != QSGText::Normal)){//If actually using the image cache
if (imageCacheDirty)
return;
d->ensureDoc();
d->doc->setText(n);
d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ d->richTextAsImage = QSGTextNode::isComplexRichText(d->doc);
} else {
d->rightToLeftText = d->text.isRightToLeft();
}
if (!wasRich && d->richText && isComponentComplete()) {
d->ensureDoc();
d->doc->setText(d->text);
+ d->richTextAsImage = QSGTextNode::isComplexRichText(d->doc);
}
d->updateLayout();
return 0;
}
- bool richTextAsImage = false;
- if (d->richText) {
- d->ensureDoc();
- richTextAsImage = QSGTextNode::isComplexRichText(d->doc);
- }
-
QRectF bounds = boundingRect();
// We need to make sure the layout is done in the current thread
d->updateLayout();
// XXX todo - some styled text can be done by the QSGTextNode
- if (richTextAsImage || d->cacheAllTextAsImage || (!QSGDistanceFieldGlyphCache::distanceFieldEnabled() && d->style != Normal)) {
+ if (d->richTextAsImage || d->cacheAllTextAsImage || (!QSGDistanceFieldGlyphCache::distanceFieldEnabled() && d->style != Normal)) {
bool wasDirty = d->imageCacheDirty;
d->checkImageCache();
d->ensureDoc();
d->doc->setText(d->text);
d->rightToLeftText = d->doc->toPlainText().isRightToLeft();
+ d->richTextAsImage = QSGTextNode::isComplexRichText(d->doc);
} else {
d->rightToLeftText = d->text.isRightToLeft();
}