forked from qt-creator/qt-creator
Fix QApplication::fontMetrics() deprecation warning
Change-Id: I9de6ccef8f6178b3344ab862b6f7506a10895722 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -209,7 +209,7 @@ QVariant SearchResultTreeModel::data(const QModelIndex &idx, int role) const
|
||||
QVariant result;
|
||||
|
||||
if (role == Qt::SizeHintRole) {
|
||||
int height = QApplication::fontMetrics().height();
|
||||
int height = QFontMetrics(QApplication::font()).height();
|
||||
if (m_editorFontIsUsed) {
|
||||
const int editorFontHeight = QFontMetrics(m_textEditorFont).height();
|
||||
height = qMax(height, editorFontHeight);
|
||||
|
@@ -302,7 +302,8 @@ void ManhattanStyle::polish(QWidget *widget)
|
||||
|
||||
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
||||
// So that text isn't cutoff in line-edits, comboboxes... etc.
|
||||
const int height = qMax(StyleHelper::navigationWidgetHeight(), QApplication::fontMetrics().height());
|
||||
const int height = qMax(StyleHelper::navigationWidgetHeight(),
|
||||
QFontMetrics(QApplication::font()).height());
|
||||
if (qobject_cast<QToolButton*>(widget)) {
|
||||
widget->setMinimumWidth(
|
||||
StyleHelper::toolbarStyle() == StyleHelper::ToolbarStyleCompact ? 24 : 28);
|
||||
|
Reference in New Issue
Block a user