diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 07150b3d00a..bd84a41614a 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -294,6 +294,14 @@ void BaseAspect::addLabeledItem(Layout &parent, QWidget *widget) } } +void BaseAspect::addLabeledItems(Layouting::Layout &parent, const QList &widgets) +{ + if (QLabel *l = createLabel()) + parent.addItem(l); + for (auto widget : widgets) + parent.addItem(widget); +} + /*! Sets \a labelText as text for the separate label in the visual representation of this aspect. diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index f1c59c908b2..6cac1b6e8e2 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -237,6 +237,7 @@ protected: QLabel *createLabel(); void addLabeledItem(Layouting::Layout &parent, QWidget *widget); + void addLabeledItems(Layouting::Layout &parent, const QList &widgets); void setDataCreatorHelper(const DataCreator &creator) const; void setDataClonerHelper(const DataCloner &cloner) const; diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 936a28a849c..a7d2186995c 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -157,6 +157,7 @@ WorkingDirectoryAspect::WorkingDirectoryAspect(AspectContainer *container) : BaseAspect(container) { setDisplayName(Tr::tr("Working Directory")); + setLabelText(Tr::tr("Working directory:")); setId("WorkingDirectoryAspect"); setSettingsKey("RunConfiguration.WorkingDirectory"); } @@ -206,7 +207,10 @@ void WorkingDirectoryAspect::addToLayoutImpl(Layout &builder) m_chooser->setReadOnly(isReadOnly()); m_resetButton->setEnabled(!isReadOnly()); - builder.addItems({Tr::tr("Working directory:"), m_chooser.data(), m_resetButton.data()}); + registerSubWidget(m_chooser); + registerSubWidget(m_resetButton); + + addLabeledItems(builder, {m_chooser.data(), m_resetButton.data()}); } void WorkingDirectoryAspect::resetPath() @@ -492,6 +496,7 @@ void ArgumentsAspect::addToLayoutImpl(Layout &builder) containerLayout->addWidget(m_resetButton); containerLayout->setAlignment(m_resetButton, Qt::AlignTop); } + registerSubWidget(container); addLabeledItem(builder, container); } diff --git a/src/plugins/projectexplorer/workspaceproject.cpp b/src/plugins/projectexplorer/workspaceproject.cpp index 61e2b4b6894..f5ca390bc85 100644 --- a/src/plugins/projectexplorer/workspaceproject.cpp +++ b/src/plugins/projectexplorer/workspaceproject.cpp @@ -368,7 +368,6 @@ public: const BuildTargetInfo bti = buildTargetInfo(); executable.setLabelText(Tr::tr("Executable:")); - executable.setReadOnly(true); executable.setValue(bti.targetFilePath); auto argumentsAsString = [this]() { @@ -378,12 +377,10 @@ public: }; arguments.setLabelText(Tr::tr("Arguments:")); - arguments.setReadOnly(true); arguments.setMacroExpander(macroExpander()); arguments.setArguments(argumentsAsString()); workingDirectory.setLabelText(Tr::tr("Working directory:")); - workingDirectory.setReadOnly(true); workingDirectory.setDefaultWorkingDirectory(bti.workingDirectory); setCommandLineGetter([this] { @@ -405,6 +402,7 @@ public: }); connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update); + setEnabled(false); } TextDisplay hint{this};