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:
@@ -137,7 +137,7 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
|
||||
m_centralWidgetStack = new QStackedWidget;
|
||||
m_statusLabel = new Utils::StatusLabel;
|
||||
m_statusLabel->setProperty("panelwidget", true);
|
||||
m_statusLabel->setIndent(2 * QFontMetrics(q->font()).width(QChar('x')));
|
||||
m_statusLabel->setIndent(2 * QFontMetrics(q->font()).horizontalAdvance(QChar('x')));
|
||||
m_editorPlaceHolder = new EditorManagerPlaceHolder;
|
||||
|
||||
m_perspectiveChooser = new QComboBox;
|
||||
@@ -423,7 +423,8 @@ void DebuggerMainWindowPrivate::selectPerspective(Perspective *perspective)
|
||||
if (index != -1) {
|
||||
m_perspectiveChooser->setCurrentIndex(index);
|
||||
|
||||
const int contentWidth = m_perspectiveChooser->fontMetrics().width(perspective->d->m_name);
|
||||
const int contentWidth =
|
||||
m_perspectiveChooser->fontMetrics().horizontalAdvance(perspective->d->m_name);
|
||||
QStyleOptionComboBox option;
|
||||
option.initFrom(m_perspectiveChooser);
|
||||
const QSize sz(contentWidth, 1);
|
||||
|
||||
Reference in New Issue
Block a user