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;
|
QVariant result;
|
||||||
|
|
||||||
if (role == Qt::SizeHintRole) {
|
if (role == Qt::SizeHintRole) {
|
||||||
int height = QApplication::fontMetrics().height();
|
int height = QFontMetrics(QApplication::font()).height();
|
||||||
if (m_editorFontIsUsed) {
|
if (m_editorFontIsUsed) {
|
||||||
const int editorFontHeight = QFontMetrics(m_textEditorFont).height();
|
const int editorFontHeight = QFontMetrics(m_textEditorFont).height();
|
||||||
height = qMax(height, editorFontHeight);
|
height = qMax(height, editorFontHeight);
|
||||||
|
@@ -302,7 +302,8 @@ void ManhattanStyle::polish(QWidget *widget)
|
|||||||
|
|
||||||
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
||||||
// So that text isn't cutoff in line-edits, comboboxes... etc.
|
// 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)) {
|
if (qobject_cast<QToolButton*>(widget)) {
|
||||||
widget->setMinimumWidth(
|
widget->setMinimumWidth(
|
||||||
StyleHelper::toolbarStyle() == StyleHelper::ToolbarStyleCompact ? 24 : 28);
|
StyleHelper::toolbarStyle() == StyleHelper::ToolbarStyleCompact ? 24 : 28);
|
||||||
|
Reference in New Issue
Block a user