ProjectExplorer: Fix test crash

actionBar can be smaller than statusBar during auto-testing,
which results in a negative value being used in qBound(), which triggers
an assert if min is bigger than max.

Change-Id: I40044cc1d6ded3c7b5e55a9bf93f88a52341237f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2022-12-08 13:50:35 +01:00
committed by Christian Kandeler
parent d0e24654f6
commit 7d573cfa0b

View File

@@ -895,7 +895,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
// Height to be aligned with side bar button
int alignedWithActionHeight = 210;
if (actionBar->isVisible())
alignedWithActionHeight = actionBar->height() - statusBar->height();
alignedWithActionHeight = qMax(0, actionBar->height() - statusBar->height());
int bottomMargin = 9;
int heightWithoutKitArea = 0;