From 7d573cfa0bf4f19631449b72ee859443375362e7 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 8 Dec 2022 13:50:35 +0100 Subject: [PATCH] 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 Reviewed-by: --- src/plugins/projectexplorer/miniprojecttargetselector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 4186eb21327..9eaa34f3948 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -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;