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:
@@ -173,7 +173,7 @@ public:
|
||||
|
||||
// topRight
|
||||
auto drawTopRight = [&](const QString text, const QFontMetrics &fm) {
|
||||
painter->drawText(opt.rect.right() - fm.width(text) - 6 , 2 + opt.rect.top() + fm.ascent(), text);
|
||||
painter->drawText(opt.rect.right() - fm.horizontalAdvance(text) - 6 , 2 + opt.rect.top() + fm.ascent(), text);
|
||||
};
|
||||
|
||||
if (device.type == AndroidDeviceInfo::Hardware) {
|
||||
|
||||
Reference in New Issue
Block a user