Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/Tools.h>
|
||||
#include <Gui/ViewProvider.h>
|
||||
|
||||
#include "Rez.h"
|
||||
@@ -719,7 +720,7 @@ int QGIView::calculateFontPixelSize(double sizeInMillimetres)
|
||||
int QGIView::calculateFontPixelWidth(const QFont &font)
|
||||
{
|
||||
// Return the width of digit 0, most likely the most wide digit
|
||||
return QFontMetrics(font).width(QChar::fromLatin1('0'));
|
||||
return Gui::QtTools::horizontalAdvance(QFontMetrics(font), QChar::fromLatin1('0'));
|
||||
}
|
||||
|
||||
const double QGIView::DefaultFontSizeInMM = 5.0;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <Base/Parameter.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Control.h>
|
||||
#include <Gui/Tools.h>
|
||||
#include <string>
|
||||
|
||||
#include <Mod/TechDraw/App/DrawPage.h>
|
||||
@@ -444,7 +445,7 @@ void QGIViewBalloon::updateBalloon(bool obtuse)
|
||||
int pos = labelText.indexOf(QString::fromUtf8("|"));
|
||||
labelText.replace(pos, 1, QString::fromUtf8(" "));
|
||||
QFontMetrics fm(balloonLabel->getFont());
|
||||
balloonLabel->seps.push_back(fm.width((labelText.left(pos + 2))));
|
||||
balloonLabel->seps.push_back(Gui::QtTools::horizontalAdvance(fm, labelText.left(pos + 2)));
|
||||
balloonLabel->verticalSep = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user