From eda5fbd64575c0c268ba173e778a256a84484191 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 19 Mar 2021 15:30:54 +0100 Subject: [PATCH] QtSupport: Do not set visibility for items without parent Avoids having the item popping up separately before adding it to its respective parent. Change-Id: I7e7d4765ebf8b1937f50670cbf04ab3bf6edbecd Reviewed-by: hjk --- src/plugins/qtsupport/qtbuildaspects.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/qtsupport/qtbuildaspects.cpp b/src/plugins/qtsupport/qtbuildaspects.cpp index 6b8b43b0567..00dd4633dc1 100644 --- a/src/plugins/qtsupport/qtbuildaspects.cpp +++ b/src/plugins/qtsupport/qtbuildaspects.cpp @@ -67,7 +67,7 @@ void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder) warningLabel->setText(warningText); setVisible(supported); const bool warningLabelsVisible = supported && !warningText.isEmpty(); - if (!warningLabel->parentWidget()) + if (warningLabel->parentWidget()) warningLabel->setVisible(warningLabelsVisible); }; connect(KitManager::instance(), &KitManager::kitsChanged, this, changeHandler); @@ -87,6 +87,7 @@ void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder) SelectionAspect::addToLayout(builder); const auto warningLabel = new Utils::InfoLabel({}, Utils::InfoLabel::Warning); warningLabel->setElideMode(Qt::ElideNone); + warningLabel->setVisible(false); builder.addRow({{}, warningLabel}); const auto changeHandler = [this, warningLabel] { QString warningText; @@ -101,7 +102,8 @@ void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder) warningLabel->setText(warningText); setVisible(supported); const bool warningLabelsVisible = supported && !warningText.isEmpty(); - warningLabel->setVisible(warningLabelsVisible); + if (warningLabel->parentWidget()) + warningLabel->setVisible(warningLabelsVisible); }; connect(KitManager::instance(), &KitManager::kitsChanged, this, changeHandler); connect(this, &QmlDebuggingAspect::changed, this, changeHandler);