Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit adb3fe2f authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen

Fix build after deprecated QFontMetrics::width()

Summary:
It was deprecated for not reporting the actual width but the
horizontal advance. Use the actual bounding width instead and
don't claim to support future deprecations.

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D11117
parent 447910aa
......@@ -69,7 +69,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX LIBKSIEVE
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050a00)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
########### CMake Config Files ###########
......
......@@ -122,7 +122,7 @@ int SieveTextEdit::lineNumberAreaWidth() const
++digits;
}
const int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits;
const int space = 2 + fontMetrics().boundingRect(QLatin1Char('9')).width() * digits;
return space;
}
......
......@@ -98,7 +98,7 @@ FindBarBase::FindBarBase(QWidget *parent)
mStatus->setTextFormat(Qt::PlainText);
QFontMetrics fm(mStatus->font());
mNotFoundString = i18n("Phrase not found");
mStatus->setFixedWidth(fm.width(mNotFoundString));
mStatus->setFixedWidth(fm.boundingRect(mNotFoundString).width());
lay->addWidget(mStatus);
setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment