forked from qt-creator/qt-creator
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 <hjk@qt.io>
This commit is contained in:
@@ -67,7 +67,7 @@ void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
warningLabel->setText(warningText);
|
warningLabel->setText(warningText);
|
||||||
setVisible(supported);
|
setVisible(supported);
|
||||||
const bool warningLabelsVisible = supported && !warningText.isEmpty();
|
const bool warningLabelsVisible = supported && !warningText.isEmpty();
|
||||||
if (!warningLabel->parentWidget())
|
if (warningLabel->parentWidget())
|
||||||
warningLabel->setVisible(warningLabelsVisible);
|
warningLabel->setVisible(warningLabelsVisible);
|
||||||
};
|
};
|
||||||
connect(KitManager::instance(), &KitManager::kitsChanged, this, changeHandler);
|
connect(KitManager::instance(), &KitManager::kitsChanged, this, changeHandler);
|
||||||
@@ -87,6 +87,7 @@ void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
SelectionAspect::addToLayout(builder);
|
SelectionAspect::addToLayout(builder);
|
||||||
const auto warningLabel = new Utils::InfoLabel({}, Utils::InfoLabel::Warning);
|
const auto warningLabel = new Utils::InfoLabel({}, Utils::InfoLabel::Warning);
|
||||||
warningLabel->setElideMode(Qt::ElideNone);
|
warningLabel->setElideMode(Qt::ElideNone);
|
||||||
|
warningLabel->setVisible(false);
|
||||||
builder.addRow({{}, warningLabel});
|
builder.addRow({{}, warningLabel});
|
||||||
const auto changeHandler = [this, warningLabel] {
|
const auto changeHandler = [this, warningLabel] {
|
||||||
QString warningText;
|
QString warningText;
|
||||||
@@ -101,7 +102,8 @@ void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
warningLabel->setText(warningText);
|
warningLabel->setText(warningText);
|
||||||
setVisible(supported);
|
setVisible(supported);
|
||||||
const bool warningLabelsVisible = supported && !warningText.isEmpty();
|
const bool warningLabelsVisible = supported && !warningText.isEmpty();
|
||||||
warningLabel->setVisible(warningLabelsVisible);
|
if (warningLabel->parentWidget())
|
||||||
|
warningLabel->setVisible(warningLabelsVisible);
|
||||||
};
|
};
|
||||||
connect(KitManager::instance(), &KitManager::kitsChanged, this, changeHandler);
|
connect(KitManager::instance(), &KitManager::kitsChanged, this, changeHandler);
|
||||||
connect(this, &QmlDebuggingAspect::changed, this, changeHandler);
|
connect(this, &QmlDebuggingAspect::changed, this, changeHandler);
|
||||||
|
Reference in New Issue
Block a user