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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user