summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-04-08 13:19:37 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-04-10 13:59:30 +0200
commit033d01bd6e2aef740ad1408a04d3ca0ae3b9ba9b (patch)
treeaf2e47a222cf6f4ed3687305df2d1cc3a578b2ed /src/widgets/itemviews
parentc0873b7832d8aaf79dda0c5c5820f97c84b399ed (diff)
QApplication: remove obsolete globalStrut functionality
Change-Id: If56873f86f5291264cac720f8db7dbd4db756f49 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp8
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp3
2 files changed, 4 insertions, 7 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 84e2fd72a9..bd79710b05 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -1570,8 +1570,7 @@ void QHeaderView::resetDefaultSectionSize()
\brief the minimum size of the header sections.
The minimum section size is the smallest section size allowed. If the
- minimum section size is set to -1, QHeaderView will use the maximum of
- the \l{QApplication::globalStrut()}{global strut} or the
+ minimum section size is set to -1, QHeaderView will use the
\l{fontMetrics()}{font metrics} size.
This property is honored by all \l{ResizeMode}{resize modes}.
@@ -1582,11 +1581,10 @@ int QHeaderView::minimumSectionSize() const
{
Q_D(const QHeaderView);
if (d->minimumSectionSize == -1) {
- QSize strut = QApplication::globalStrut();
int margin = 2 * style()->pixelMetric(QStyle::PM_HeaderMargin, nullptr, this);
if (d->orientation == Qt::Horizontal)
- return qMax(strut.width(), (fontMetrics().maxWidth() + margin));
- return qMax(strut.height(), (fontMetrics().height() + margin));
+ return fontMetrics().maxWidth() + margin;
+ return fontMetrics().height() + margin;
}
return d->minimumSectionSize;
}
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index fe9b482122..b29fd373bc 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -577,8 +577,7 @@ void QExpandingLineEdit::updateMinimumWidth()
QStyleOptionFrame opt;
initStyleOption(&opt);
- int minWidth = style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(width, 0).
- expandedTo(QApplication::globalStrut()), this).width();
+ int minWidth = style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(width, 0), this).width();
setMinimumWidth(minWidth);
}