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>
This commit is contained in:
Zou Ya 2021-03-03 20:37:15 +08:00 committed by Qt Cherry-pick Bot
parent 8dbc4d029e
commit fd2fa0e2b0

View File

@ -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);