QtSupport: Use createSubWidget for Qml related aspects

Change-Id: I8ceb64cdd96abe241fd81b411200871e7d061a97
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-03-23 09:08:45 +01:00
parent 072607962d
commit f28b0fe6a1

View File

@@ -52,7 +52,7 @@ QmlDebuggingAspect::QmlDebuggingAspect()
void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder) void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder)
{ {
SelectionAspect::addToLayout(builder); SelectionAspect::addToLayout(builder);
const auto warningLabel = new Utils::InfoLabel({}, Utils::InfoLabel::Warning); const auto warningLabel = createSubWidget<InfoLabel>(QString(), InfoLabel::Warning);
warningLabel->setElideMode(Qt::ElideNone); warningLabel->setElideMode(Qt::ElideNone);
builder.addRow({{}, warningLabel}); builder.addRow({{}, warningLabel});
const auto changeHandler = [this, warningLabel] { const auto changeHandler = [this, warningLabel] {
@@ -85,7 +85,7 @@ QtQuickCompilerAspect::QtQuickCompilerAspect()
void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder) void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder)
{ {
SelectionAspect::addToLayout(builder); SelectionAspect::addToLayout(builder);
const auto warningLabel = new Utils::InfoLabel({}, Utils::InfoLabel::Warning); const auto warningLabel = createSubWidget<InfoLabel>(QString(), InfoLabel::Warning);
warningLabel->setElideMode(Qt::ElideNone); warningLabel->setElideMode(Qt::ElideNone);
warningLabel->setVisible(false); warningLabel->setVisible(false);
builder.addRow({{}, warningLabel}); builder.addRow({{}, warningLabel});