From fd2fa0e2b026c6e967ec7cb9302eabf1f3f5de1d Mon Sep 17 00:00:00 2001 From: Zou Ya Date: Wed, 3 Mar 2021 20:37:15 +0800 Subject: [PATCH] Redundant condition: tornoff Redundant condition: tornoff. '!tornoff || (tornoff && scroll)' is equivalent to '!tornoff || scroll' Change-Id: I8339faa4d53360db280173ee489e48eba4883b70 Reviewed-by: Edward Welbourne (cherry picked from commit 712117f8b89cdb2578d6aaa424141da216799fe9) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/widgets/qmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index d704aac525c..c6a130195cf 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -472,7 +472,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 + if (!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, 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);