diff options
author | Kari Hautamäki <kari.hautamaki@theqtcompany.com> | 2015-04-20 15:05:59 +0300 |
---|---|---|
committer | Kari Hautamäki <kari.hautamaki@theqtcompany.com> | 2016-05-20 08:20:07 +0000 |
commit | afd01a7341df6ab5629469d9b55ab4f1b195cff0 (patch) | |
tree | bfb43518afb74f4297f14a6f47c025c9573b1212 /src | |
parent | ad069828db14cbb9d657b482a802358924c6b947 (diff) |
Don't render when width is zero and elide is not None
Works now similarly as with very small text lengths (smaller than
elide characted length).
Change-Id: I0c4aafbcc50343bb0ec8b5f335045e1048a499fd
Task-number: QTBUG-34990
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index f3254cf8d7..8b1d47ac0b 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -650,6 +650,11 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline) emit q->lineCountChanged(); } + if (qFuzzyIsNull(q->width())) { + layout.setText(QString()); + textHasChanged = true; + } + QFontMetricsF fm(font); qreal height = (lineHeightMode() == QQuickText::FixedHeight) ? lineHeight() : qCeil(fm.height()) * lineHeight(); *baseline = fm.ascent(); |