summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZou Ya <zouya@uniontech.com>2021-03-03 20:37:15 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-30 15:10:16 +0000
commitfd2fa0e2b026c6e967ec7cb9302eabf1f3f5de1d (patch)
tree7eb5ad2b5022bace298f929a7c7d8a19f0d1bbc4
parent8dbc4d029e4cfc2a947ccfd370dadda54abe0326 (diff)
Redundant condition: tornoff
Redundant condition: tornoff. '!tornoff || (tornoff && scroll)' is equivalent to '!tornoff || scroll' Change-Id: I8339faa4d53360db280173ee489e48eba4883b70 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 712117f8b89cdb2578d6aaa424141da216799fe9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/widgets/widgets/qmenu.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index d704aac525..c6a130195c 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);