summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/textmark.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-02-11 10:32:46 +0100
committerhjk <hjk@qt.io>2019-02-15 15:12:02 +0000
commitec6b38dea0a9c7f5b2b45dff6cbb2b1479f44878 (patch)
tree00a9e1596699485c20f34ba8300981f4c726d4ed /src/plugins/texteditor/textmark.cpp
parent6eac37a7d93396f03f00f00135e06a82cdda1cf4 (diff)
downloadqt-creator-ec6b38dea0a9c7f5b2b45dff6cbb2b1479f44878.tar.gz
Fix Qt 5.13 deprecation warning about QFontMetrics::width()
Replace by QFontMetrics::horizontalAdvance(), fixing: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] Change-Id: I9991ffefe6e87e872dc35ba291d562e06b28ca64 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/texteditor/textmark.cpp')
-rw-r--r--src/plugins/texteditor/textmark.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp
index 22ddbbec03..cccf526b91 100644
--- a/src/plugins/texteditor/textmark.cpp
+++ b/src/plugins/texteditor/textmark.cpp
@@ -182,7 +182,7 @@ TextMark::AnnotationRects TextMark::annotationRects(const QRectF &boundingRect,
if (drawIcon)
rects.iconRect.setWidth(rects.iconRect.height() * m_widthFactor);
rects.textRect = QRectF(rects.iconRect.right() + margin, boundingRect.top(),
- qreal(fm.width(rects.text)), boundingRect.height());
+ qreal(fm.horizontalAdvance(rects.text)), boundingRect.height());
rects.annotationRect.setRight(rects.textRect.right() + margin);
if (rects.annotationRect.right() > boundingRect.right()) {
rects.textRect.setRight(boundingRect.right() - margin);