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/refactoroverlay.cpp | |
parent | 6eac37a7d93396f03f00f00135e06a82cdda1cf4 (diff) |
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/refactoroverlay.cpp')
-rw-r--r-- | src/plugins/texteditor/refactoroverlay.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/texteditor/refactoroverlay.cpp b/src/plugins/texteditor/refactoroverlay.cpp index 65ef1dae0a..33a18f818f 100644 --- a/src/plugins/texteditor/refactoroverlay.cpp +++ b/src/plugins/texteditor/refactoroverlay.cpp @@ -81,8 +81,9 @@ void RefactorOverlay::paintMarker(const RefactorMarker& marker, QPainter *painte icon = m_icon; const qreal devicePixelRatio = painter->device()->devicePixelRatio(); - const QSize proposedIconSize = QSize(m_editor->fontMetrics().width(QLatin1Char(' ')) + 3, - cursorRect.height()) * devicePixelRatio; + const QSize proposedIconSize = + QSize(m_editor->fontMetrics().horizontalAdvance(QLatin1Char(' ')) + 3, + cursorRect.height()) * devicePixelRatio; const QSize actualIconSize = icon.actualSize(proposedIconSize) / devicePixelRatio; const int y = cursorRect.top() + ((cursorRect.height() - actualIconSize.height()) / 2); |