summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu.cpp
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/widgets/qmenu.cpp
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/widgets/qmenu.cpp')
-rw-r--r--src/widgets/widgets/qmenu.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 31a7ad8695..86bc3d69be 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -307,7 +307,7 @@ QPlatformMenuItem * QMenuPrivate::insertActionInPlatformMenu(const QAction *acti
int QMenuPrivate::scrollerHeight() const
{
Q_Q(const QMenu);
- return qMax(QApplication::globalStrut().height(), q->style()->pixelMetric(QStyle::PM_MenuScrollerHeight, nullptr, q));
+ return q->style()->pixelMetric(QStyle::PM_MenuScrollerHeight, nullptr, q);
}
// Windows and KDE allow menus to cover the taskbar, while GNOME and macOS
@@ -476,7 +476,7 @@ void QMenuPrivate::updateActionRects(const QRect &screen) const
max_column_width += tabWidth; //finally add in the tab width
if (!tornoff || (tornoff && scroll)) { // exclude non-scrollable tear-off menu since the tear-off menu has a fixed size
- const int sfcMargin = style->sizeFromContents(QStyle::CT_Menu, &opt, QApplication::globalStrut(), q).width() - QApplication::globalStrut().width();
+ const int sfcMargin = style->sizeFromContents(QStyle::CT_Menu, &opt, QSize(0, 0), q).width();
const int min_column_width = q->minimumWidth() - (sfcMargin + leftmargin + rightmargin + 2 * (fw + hmargin));
max_column_width = qMax(min_column_width, max_column_width);
}
@@ -2308,8 +2308,7 @@ QSize QMenu::sizeHint() const
s.rwidth() += style()->pixelMetric(QStyle::PM_MenuHMargin, &opt, this) + fw + d->rightmargin;
s.rheight() += style()->pixelMetric(QStyle::PM_MenuVMargin, &opt, this) + fw + d->bottommargin;
- return style()->sizeFromContents(QStyle::CT_Menu, &opt,
- s.expandedTo(QApplication::globalStrut()), this);
+ return style()->sizeFromContents(QStyle::CT_Menu, &opt, s, this);
}
/*!