diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-02-11 10:32:46 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-02-15 15:12:02 +0000 |
commit | ec6b38dea0a9c7f5b2b45dff6cbb2b1479f44878 (patch) | |
tree | 00a9e1596699485c20f34ba8300981f4c726d4ed /src/plugins/texteditor/textmark.cpp | |
parent | 6eac37a7d93396f03f00f00135e06a82cdda1cf4 (diff) | |
download | qt-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.cpp | 2 |
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); |