forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user