Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
|
||||
#include "SoDatumLabel.h"
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Tools.h>
|
||||
|
||||
#define ZCONSTR 0.006f
|
||||
|
||||
@@ -116,7 +117,7 @@ void SoDatumLabel::drawImage()
|
||||
QFontMetrics fm(font);
|
||||
QString str = QString::fromUtf8(s[0].getString());
|
||||
|
||||
int w = fm.width(str);
|
||||
int w = Gui::QtTools::horizontalAdvance(fm, str);
|
||||
int h = fm.height();
|
||||
|
||||
// No Valid text
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
#include <Gui/CommandT.h>
|
||||
#include <Gui/Control.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/Tools.h>
|
||||
#include <Gui/Utilities.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/MenuManager.h>
|
||||
@@ -3471,7 +3472,7 @@ QImage ViewProviderSketch::renderConstrIcon(const QString &type,
|
||||
boundingBoxes->push_back(labelBB);
|
||||
}
|
||||
|
||||
cursorOffset += qfm.width(labelStr);
|
||||
cursorOffset += Gui::QtTools::horizontalAdvance(qfm, labelStr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user