diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-10 12:49:46 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-13 16:34:34 +0000 |
commit | 57604562db870f7b05d4349761d73e054dbe04c6 (patch) | |
tree | 1c54f4b21fbb7f7eecd6a46e5201706ab86afcc4 /src/quick/items/qquicktext.cpp | |
parent | 48402d5c4c97bae5762668aaaf9670c644120feb (diff) |
QtDeclarative: replace deprecated functions
Replace the deprecated functions with it successors:
- QFontMetrics::width() -> horizontalAdvance()
- QLayout::setMargin() -> setContentsMargins()
Change-Id: I2a2557cdb2eaec40e2c9955a0082372c582ec6b8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquicktext.cpp')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index dd7fbccff5..9e447d40ac 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -643,7 +643,7 @@ QString QQuickTextPrivate::elidedText(qreal lineWidth, const QTextLine &line, QT // Appending the elide character may push the line over the maximum width // in which case the elided text will need to be elided. QFontMetricsF metrics(layout.font()); - if (metrics.width(elideChar) + line.naturalTextWidth() >= lineWidth) + if (metrics.horizontalAdvance(elideChar) + line.naturalTextWidth() >= lineWidth) elideText = metrics.elidedText(elideText, Qt::TextElideMode(elideMode), lineWidth); } return elideText; |