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), nodeType(NodeIsNull)
+ layoutTextElided(false), naturalWidth(0), doc(0), layoutThread(0), nodeType(NodeIsNull)
{
cacheAllTextAsImage = enableImageCache();
}
bool elideText = false;
bool truncate = false;
+ layoutThread = QThread::currentThread();
+
QFontMetrics fm(layout.font());
elidePos = QPointF();
QRectF bounds = boundingRect();
+ // We need to make sure the layout is done in the current thread
+ if (d->layoutThread != QThread::currentThread())
+ d->updateLayout();
+
// XXX todo - some styled text can be done by the QSGTextNode
if (richTextAsImage || d->cacheAllTextAsImage || (!QSGDistanceFieldGlyphCache::distanceFieldEnabled() && d->style != Normal)) {
bool wasDirty = d->imageCacheDirty;
QPixmap textLayoutImage(bool drawStyle);
void drawTextLayout(QPainter *p, const QPointF &pos, bool drawStyle);
QTextLayout layout;
+ QThread *layoutThread;
static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource);
static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource, int yOffset);