forked from qt-creator/qt-creator
ProjectExplorer: Dismantle NamedWidget
... which was really just a widget with a name. Providing the name separately simplifies the code and makes the setup structurally more similar to the BaseAspect::addToLayout() machinery. Change-Id: I0c528e0afb3c22eb0acac8f181cc36a6ab74d95b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
#include <projectexplorer/environmentwidget.h>
|
||||
#include <projectexplorer/kitaspect.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/namedwidget.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -111,7 +110,7 @@ const char VXWORKS_DEVICE_TYPE[] = "VxWorks.Device.Type";
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class CMakeBuildSettingsWidget : public NamedWidget
|
||||
class CMakeBuildSettingsWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc);
|
||||
@@ -193,7 +192,6 @@ static CMakeConfigItem getPackageManagerAutoSetupParameter()
|
||||
}
|
||||
|
||||
CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) :
|
||||
NamedWidget(Tr::tr("CMake")),
|
||||
m_buildConfig(bc),
|
||||
m_configModel(new ConfigModel(this)),
|
||||
m_configFilterModel(new CategorySortFilterModel(this)),
|
||||
@@ -1408,6 +1406,7 @@ static Utils::EnvironmentItems getEnvironmentItemsFromCMakeBuildPreset(
|
||||
CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
||||
: BuildConfiguration(target, id)
|
||||
{
|
||||
setConfigWidgetDisplayName(Tr::tr("CMake"));
|
||||
m_buildSystem = new CMakeBuildSystem(this);
|
||||
|
||||
buildDirectoryAspect()->setValueAcceptor(
|
||||
@@ -1839,7 +1838,7 @@ QString CMakeBuildSystem::warning() const
|
||||
return m_warning;
|
||||
}
|
||||
|
||||
NamedWidget *CMakeBuildConfiguration::createConfigWidget()
|
||||
QWidget *CMakeBuildConfiguration::createConfigWidget()
|
||||
{
|
||||
m_configWidget = new CMakeBuildSettingsWidget(this);
|
||||
return m_configWidget;
|
||||
|
@@ -105,9 +105,7 @@ signals:
|
||||
|
||||
private:
|
||||
BuildType buildType() const override;
|
||||
|
||||
ProjectExplorer::NamedWidget *createConfigWidget() override;
|
||||
|
||||
QWidget *createConfigWidget() override;
|
||||
virtual CMakeConfig signingFlags() const;
|
||||
|
||||
void setInitialBuildAndCleanSteps(const ProjectExplorer::Target *target);
|
||||
|
@@ -18,7 +18,6 @@
|
||||
#include <projectexplorer/gcctoolchain.h>
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/namedwidget.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
#include <projectexplorer/projectupdater.h>
|
||||
|
@@ -9,7 +9,6 @@
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildinfo.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/namedwidget.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -34,6 +33,7 @@ public:
|
||||
HaskellBuildConfiguration(Target *target, Utils::Id id)
|
||||
: BuildConfiguration(target, id)
|
||||
{
|
||||
setConfigWidgetDisplayName(Tr::tr("General"));
|
||||
setInitializer([this](const BuildInfo &info) {
|
||||
setBuildDirectory(info.buildDirectory);
|
||||
setBuildType(info.buildType);
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
appendInitialBuildStep(Constants::C_STACK_BUILD_STEP_ID);
|
||||
}
|
||||
|
||||
NamedWidget *createConfigWidget() final;
|
||||
QWidget *createConfigWidget() final;
|
||||
|
||||
BuildType buildType() const final
|
||||
{
|
||||
@@ -58,11 +58,10 @@ private:
|
||||
BuildType m_buildType = BuildType::Release;
|
||||
};
|
||||
|
||||
class HaskellBuildConfigurationWidget final : public NamedWidget
|
||||
class HaskellBuildConfigurationWidget final : public QWidget
|
||||
{
|
||||
public:
|
||||
HaskellBuildConfigurationWidget(HaskellBuildConfiguration *bc)
|
||||
: NamedWidget(Tr::tr("General"))
|
||||
{
|
||||
setLayout(new QVBoxLayout);
|
||||
layout()->setContentsMargins(0, 0, 0, 0);
|
||||
@@ -95,7 +94,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
NamedWidget *HaskellBuildConfiguration::createConfigWidget()
|
||||
QWidget *HaskellBuildConfiguration::createConfigWidget()
|
||||
{
|
||||
return new HaskellBuildConfigurationWidget(this);
|
||||
}
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#include "iostr.h"
|
||||
|
||||
#include <projectexplorer/devicesupport/devicekitaspects.h>
|
||||
#include <projectexplorer/namedwidget.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <cmakeprojectmanager/cmakebuildconfiguration.h>
|
||||
@@ -44,7 +43,7 @@ const char autoManagedSigningKey[] = "Ios.AutoManagedSigning";
|
||||
|
||||
const int IdentifierRole = Qt::UserRole+1;
|
||||
|
||||
class IosSigningSettingsWidget final : public NamedWidget
|
||||
class IosSigningSettingsWidget final : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit IosSigningSettingsWidget(BuildConfiguration *buildConfiguration,
|
||||
@@ -84,8 +83,7 @@ private:
|
||||
IosSigningSettingsWidget::IosSigningSettingsWidget(BuildConfiguration *buildConfiguration,
|
||||
BoolAspect *autoManagedSigning,
|
||||
StringAspect *signingIdentifier)
|
||||
: NamedWidget(Tr::tr("iOS Settings"))
|
||||
, m_autoManagedSigning(autoManagedSigning)
|
||||
: m_autoManagedSigning(autoManagedSigning)
|
||||
, m_signingIdentifier(signingIdentifier)
|
||||
, m_isDevice(RunDeviceTypeKitAspect::deviceTypeId(buildConfiguration->kit())
|
||||
== Constants::IOS_DEVICE_TYPE)
|
||||
@@ -376,7 +374,7 @@ public:
|
||||
IosQmakeBuildConfiguration(Target *target, Id id);
|
||||
|
||||
private:
|
||||
QList<NamedWidget *> createSubConfigWidgets() final;
|
||||
void addSubConfigWidgets(const BuildConfiguration::WidgetAdder &adder) final;
|
||||
void fromMap(const Store &map) final;
|
||||
|
||||
void updateQmakeCommand();
|
||||
@@ -403,16 +401,13 @@ IosQmakeBuildConfiguration::IosQmakeBuildConfiguration(Target *target, Id id)
|
||||
&IosQmakeBuildConfiguration::updateQmakeCommand);
|
||||
}
|
||||
|
||||
QList<NamedWidget *> IosQmakeBuildConfiguration::createSubConfigWidgets()
|
||||
void IosQmakeBuildConfiguration::addSubConfigWidgets(const BuildConfiguration::WidgetAdder &adder)
|
||||
{
|
||||
auto subConfigWidgets = QmakeBuildConfiguration::createSubConfigWidgets();
|
||||
|
||||
// Ownership of this widget is with BuildSettingsWidget
|
||||
auto buildSettingsWidget = new IosSigningSettingsWidget(this,
|
||||
&m_autoManagedSigning,
|
||||
&m_signingIdentifier);
|
||||
subConfigWidgets.prepend(buildSettingsWidget);
|
||||
return subConfigWidgets;
|
||||
adder(new IosSigningSettingsWidget(this, &m_autoManagedSigning, &m_signingIdentifier),
|
||||
Tr::tr("iOS Settings"));
|
||||
|
||||
QmakeBuildConfiguration::addSubConfigWidgets(adder);
|
||||
}
|
||||
|
||||
void IosQmakeBuildConfiguration::fromMap(const Store &map)
|
||||
@@ -493,7 +488,7 @@ public:
|
||||
IosCMakeBuildConfiguration(Target *target, Id id);
|
||||
|
||||
private:
|
||||
QList<NamedWidget *> createSubConfigWidgets() final;
|
||||
void addSubConfigWidgets(const BuildConfiguration::WidgetAdder &adder) final;
|
||||
|
||||
CMakeProjectManager::CMakeConfig signingFlags() const final;
|
||||
|
||||
@@ -519,16 +514,12 @@ IosCMakeBuildConfiguration::IosCMakeBuildConfiguration(Target *target, Id id)
|
||||
&IosCMakeBuildConfiguration::signingFlagsChanged);
|
||||
}
|
||||
|
||||
QList<NamedWidget *> IosCMakeBuildConfiguration::createSubConfigWidgets()
|
||||
void IosCMakeBuildConfiguration::addSubConfigWidgets(const WidgetAdder &adder)
|
||||
{
|
||||
auto subConfigWidgets = CMakeBuildConfiguration::createSubConfigWidgets();
|
||||
|
||||
// Ownership of this widget is with BuildSettingsWidget
|
||||
auto buildSettingsWidget = new IosSigningSettingsWidget(this,
|
||||
&m_autoManagedSigning,
|
||||
&m_signingIdentifier);
|
||||
subConfigWidgets.prepend(buildSettingsWidget);
|
||||
return subConfigWidgets;
|
||||
adder(new IosSigningSettingsWidget(this, &m_autoManagedSigning, &m_signingIdentifier),
|
||||
Tr::tr("iOS Settings"));
|
||||
CMakeBuildConfiguration::addSubConfigWidgets(adder);
|
||||
}
|
||||
|
||||
CMakeConfig IosCMakeBuildConfiguration::signingFlags() const
|
||||
|
@@ -17,7 +17,6 @@
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/namedwidget.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectconfiguration.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -70,6 +69,7 @@ static FilePath shadowBuildDirectory(const FilePath &projectFilePath,
|
||||
MesonBuildConfiguration::MesonBuildConfiguration(ProjectExplorer::Target *target, Id id)
|
||||
: BuildConfiguration(target, id)
|
||||
{
|
||||
setConfigWidgetDisplayName(Tr::tr("Meson"));
|
||||
appendInitialBuildStep(Constants::MESON_BUILD_STEP_ID);
|
||||
appendInitialCleanStep(Constants::MESON_BUILD_STEP_ID);
|
||||
setInitializer([this, target](const ProjectExplorer::BuildInfo &info) {
|
||||
@@ -152,11 +152,11 @@ void MesonBuildConfiguration::fromMap(const Store &map)
|
||||
m_parameters = map.value(Constants::BuildConfiguration::PARAMETERS_KEY).toString();
|
||||
}
|
||||
|
||||
class MesonBuildSettingsWidget : public NamedWidget
|
||||
class MesonBuildSettingsWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit MesonBuildSettingsWidget(MesonBuildConfiguration *buildCfg)
|
||||
: NamedWidget(Tr::tr("Meson")), m_progressIndicator(ProgressIndicatorSize::Large)
|
||||
: m_progressIndicator(ProgressIndicatorSize::Large)
|
||||
{
|
||||
auto configureButton = new QPushButton(Tr::tr("Apply Configuration Changes"));
|
||||
configureButton->setEnabled(false);
|
||||
@@ -300,7 +300,7 @@ private:
|
||||
QTimer m_showProgressTimer;
|
||||
};
|
||||
|
||||
NamedWidget *MesonBuildConfiguration::createConfigWidget()
|
||||
QWidget *MesonBuildConfiguration::createConfigWidget()
|
||||
{
|
||||
return new MesonBuildSettingsWidget{this};
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ private:
|
||||
void fromMap(const Utils::Store &map) override;
|
||||
|
||||
MesonBuildType m_buildType;
|
||||
ProjectExplorer::NamedWidget *createConfigWidget() final;
|
||||
QWidget *createConfigWidget() final;
|
||||
MesonBuildSystem *m_buildSystem = nullptr;
|
||||
QString m_parameters;
|
||||
};
|
||||
|
@@ -116,7 +116,6 @@ add_qtc_plugin(ProjectExplorer
|
||||
miniprojecttargetselector.cpp miniprojecttargetselector.h
|
||||
msvcparser.cpp msvcparser.h
|
||||
msvctoolchain.cpp msvctoolchain.h
|
||||
namedwidget.cpp namedwidget.h
|
||||
osparser.cpp osparser.h
|
||||
panelswidget.cpp panelswidget.h
|
||||
parseissuesdialog.cpp parseissuesdialog.h
|
||||
|
@@ -13,7 +13,6 @@
|
||||
#include "devicesupport/devicekitaspects.h"
|
||||
#include "environmentwidget.h"
|
||||
#include "kit.h"
|
||||
#include "namedwidget.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorertr.h"
|
||||
@@ -54,12 +53,10 @@ Q_LOGGING_CATEGORY(bcLog, "qtc.buildconfig", QtWarningMsg)
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
class BuildEnvironmentWidget : public NamedWidget
|
||||
class BuildEnvironmentWidget : public QWidget
|
||||
{
|
||||
|
||||
public:
|
||||
explicit BuildEnvironmentWidget(BuildConfiguration *bc)
|
||||
: NamedWidget(Tr::tr("Build Environment"))
|
||||
{
|
||||
auto clearBox = new QCheckBox(Tr::tr("Clear system environment"), this);
|
||||
clearBox->setChecked(!bc->useSystemEnvironment());
|
||||
@@ -97,10 +94,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class CustomParsersBuildWidget : public NamedWidget
|
||||
class CustomParsersBuildWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
CustomParsersBuildWidget(BuildConfiguration *bc) : NamedWidget(Tr::tr("Custom Output Parsers"))
|
||||
CustomParsersBuildWidget(BuildConfiguration *bc)
|
||||
{
|
||||
const auto layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
@@ -254,17 +251,17 @@ void BuildConfiguration::setBuildDirectory(const FilePath &dir)
|
||||
emitBuildDirectoryChanged();
|
||||
}
|
||||
|
||||
void BuildConfiguration::addConfigWidgets(const std::function<void(NamedWidget *)> &adder)
|
||||
void BuildConfiguration::addConfigWidgets(const WidgetAdder &adder)
|
||||
{
|
||||
if (NamedWidget *generalConfigWidget = createConfigWidget())
|
||||
adder(generalConfigWidget);
|
||||
if (QWidget *generalConfigWidget = createConfigWidget())
|
||||
adder(generalConfigWidget, d->m_configWidgetDisplayName);
|
||||
|
||||
adder(new Internal::BuildStepListWidget(buildSteps()));
|
||||
adder(new Internal::BuildStepListWidget(cleanSteps()));
|
||||
//: %1 is the name returned by BuildStepList::displayName
|
||||
const QString title = Tr::tr("%1 Steps");
|
||||
adder(new Internal::BuildStepListWidget(buildSteps()), title.arg(buildSteps()->displayName()));
|
||||
adder(new Internal::BuildStepListWidget(cleanSteps()), title.arg(cleanSteps()->displayName()));
|
||||
|
||||
const QList<NamedWidget *> subConfigWidgets = createSubConfigWidgets();
|
||||
for (NamedWidget *subConfigWidget : subConfigWidgets)
|
||||
adder(subConfigWidget);
|
||||
addSubConfigWidgets(adder);
|
||||
}
|
||||
|
||||
void BuildConfiguration::doInitialize(const BuildInfo &info)
|
||||
@@ -316,9 +313,9 @@ void BuildConfiguration::setInitializer(const std::function<void(const BuildInfo
|
||||
d->m_initializer = initializer;
|
||||
}
|
||||
|
||||
NamedWidget *BuildConfiguration::createConfigWidget()
|
||||
QWidget *BuildConfiguration::createConfigWidget()
|
||||
{
|
||||
NamedWidget *named = new NamedWidget(d->m_configWidgetDisplayName);
|
||||
QWidget *named = new QWidget;
|
||||
|
||||
QWidget *widget = nullptr;
|
||||
|
||||
@@ -348,12 +345,10 @@ NamedWidget *BuildConfiguration::createConfigWidget()
|
||||
return named;
|
||||
}
|
||||
|
||||
QList<NamedWidget *> BuildConfiguration::createSubConfigWidgets()
|
||||
void BuildConfiguration::addSubConfigWidgets(const WidgetAdder &adder)
|
||||
{
|
||||
return {
|
||||
new Internal::BuildEnvironmentWidget(this),
|
||||
new Internal::CustomParsersBuildWidget(this)
|
||||
};
|
||||
adder(new Internal::BuildEnvironmentWidget(this), Tr::tr("Build Environment"));
|
||||
adder(new Internal::CustomParsersBuildWidget(this), Tr::tr("Custom Output Parsers"));
|
||||
}
|
||||
|
||||
BuildSystem *BuildConfiguration::buildSystem() const
|
||||
|
@@ -21,7 +21,6 @@ class BuildInfo;
|
||||
class BuildSystem;
|
||||
class BuildStepList;
|
||||
class Kit;
|
||||
class NamedWidget;
|
||||
class Node;
|
||||
class RunConfiguration;
|
||||
class Target;
|
||||
@@ -43,8 +42,11 @@ public:
|
||||
|
||||
virtual BuildSystem *buildSystem() const;
|
||||
|
||||
virtual NamedWidget *createConfigWidget();
|
||||
virtual QList<NamedWidget *> createSubConfigWidgets();
|
||||
virtual QWidget *createConfigWidget();
|
||||
|
||||
using WidgetAdder = std::function<void(QWidget *, const QString &)>;
|
||||
void addConfigWidgets(const WidgetAdder &adder);
|
||||
virtual void addSubConfigWidgets(const WidgetAdder &adder);
|
||||
|
||||
// Maybe the BuildConfiguration is not the best place for the environment
|
||||
Utils::Environment baseEnvironment() const;
|
||||
@@ -107,8 +109,6 @@ public:
|
||||
void setConfigWidgetHasFrame(bool configWidgetHasFrame);
|
||||
void setBuildDirectorySettingsKey(const Utils::Key &key);
|
||||
|
||||
void addConfigWidgets(const std::function<void (NamedWidget *)> &adder);
|
||||
|
||||
void doInitialize(const BuildInfo &info);
|
||||
|
||||
bool createBuildDirectory();
|
||||
|
@@ -6,7 +6,6 @@
|
||||
#include "buildconfiguration.h"
|
||||
#include "buildinfo.h"
|
||||
#include "buildmanager.h"
|
||||
#include "namedwidget.h"
|
||||
#include "project.h"
|
||||
#include "projectconfigurationmodel.h"
|
||||
#include "projectexplorertr.h"
|
||||
@@ -121,13 +120,13 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
|
||||
connect(m_target, &Target::kitChanged, this, &BuildSettingsWidget::updateAddButtonMenu);
|
||||
}
|
||||
|
||||
void BuildSettingsWidget::addSubWidget(NamedWidget *widget)
|
||||
void BuildSettingsWidget::addSubWidget(QWidget *widget, const QString &displayName)
|
||||
{
|
||||
widget->setParent(this);
|
||||
widget->setContentsMargins(0, 2, 0, 0);
|
||||
|
||||
auto label = new QLabel(this);
|
||||
label->setText(widget->displayName());
|
||||
label->setText(displayName);
|
||||
label->setFont(StyleHelper::uiFont(StyleHelper::UiElementH4));
|
||||
|
||||
label->setContentsMargins(0, 18, 0, 0);
|
||||
@@ -174,8 +173,11 @@ void BuildSettingsWidget::updateBuildSettings()
|
||||
m_renameButton->setEnabled(!bcs.isEmpty());
|
||||
m_cloneButton->setEnabled(!bcs.isEmpty());
|
||||
|
||||
if (m_buildConfiguration)
|
||||
m_buildConfiguration->addConfigWidgets([this](NamedWidget *w) { addSubWidget(w); });
|
||||
if (m_buildConfiguration) {
|
||||
m_buildConfiguration->addConfigWidgets([this](QWidget *w, const QString &displayName) {
|
||||
addSubWidget(w, displayName);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void BuildSettingsWidget::currentIndexChanged(int index)
|
||||
|
@@ -16,7 +16,6 @@ namespace ProjectExplorer {
|
||||
|
||||
class BuildConfiguration;
|
||||
class BuildInfo;
|
||||
class NamedWidget;
|
||||
class Target;
|
||||
|
||||
namespace Internal {
|
||||
@@ -29,7 +28,7 @@ public:
|
||||
~BuildSettingsWidget() override;
|
||||
|
||||
void clearWidgets();
|
||||
void addSubWidget(NamedWidget *widget);
|
||||
void addSubWidget(QWidget *widget, const QString &displayName);
|
||||
|
||||
private:
|
||||
void updateBuildSettings();
|
||||
@@ -56,7 +55,7 @@ private:
|
||||
QComboBox *m_buildConfigurationComboBox = nullptr;
|
||||
QMenu *m_addButtonMenu = nullptr;
|
||||
|
||||
QList<NamedWidget *> m_subWidgets;
|
||||
QList<QWidget *> m_subWidgets;
|
||||
QList<QLabel *> m_labels;
|
||||
};
|
||||
|
||||
|
@@ -167,8 +167,7 @@ BuildStepsWidgetData::~BuildStepsWidgetData()
|
||||
}
|
||||
|
||||
BuildStepListWidget::BuildStepListWidget(BuildStepList *bsl)
|
||||
//: %1 is the name returned by BuildStepList::displayName
|
||||
: NamedWidget(Tr::tr("%1 Steps").arg(bsl->displayName())), m_buildStepList(bsl)
|
||||
: m_buildStepList(bsl)
|
||||
{
|
||||
setupUi();
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "buildstep.h"
|
||||
#include "namedwidget.h"
|
||||
|
||||
#include <utils/detailsbutton.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
ToolWidget *toolWidget;
|
||||
};
|
||||
|
||||
class BuildStepListWidget : public NamedWidget
|
||||
class BuildStepListWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -1,18 +0,0 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "namedwidget.h"
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
NamedWidget::NamedWidget(const QString &displayName, QWidget *parent)
|
||||
: QWidget(parent), m_displayName(displayName)
|
||||
{
|
||||
}
|
||||
|
||||
QString NamedWidget::displayName() const
|
||||
{
|
||||
return m_displayName;
|
||||
}
|
||||
|
||||
} // ProjectExplorer
|
@@ -1,23 +0,0 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT NamedWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit NamedWidget(const QString &displayName, QWidget *parent = nullptr);
|
||||
|
||||
QString displayName() const;
|
||||
|
||||
private:
|
||||
QString m_displayName;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
@@ -52,7 +52,6 @@
|
||||
#include "kitfeatureprovider.h"
|
||||
#include "kitmanager.h"
|
||||
#include "miniprojecttargetselector.h"
|
||||
#include "namedwidget.h"
|
||||
#include "outputparser_test.h"
|
||||
#include "parseissuesdialog.h"
|
||||
#include "processstep.h"
|
||||
|
@@ -90,7 +90,6 @@ QtcPlugin {
|
||||
"miniprojecttargetselector.cpp", "miniprojecttargetselector.h",
|
||||
"msvcparser.cpp", "msvcparser.h",
|
||||
"msvctoolchain.cpp", "msvctoolchain.h",
|
||||
"namedwidget.cpp", "namedwidget.h",
|
||||
"osparser.cpp", "osparser.h",
|
||||
"panelswidget.cpp", "panelswidget.h",
|
||||
"parseissuesdialog.cpp", "parseissuesdialog.h",
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/environmentaspect.h>
|
||||
#include <projectexplorer/namedwidget.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
@@ -211,11 +210,10 @@ Id PySideBuildStep::id()
|
||||
return Id("Python.PysideBuildStep");
|
||||
}
|
||||
|
||||
class PythonBuildSettingsWidget : public NamedWidget
|
||||
class PythonBuildSettingsWidget : public QWidget
|
||||
{
|
||||
public:
|
||||
PythonBuildSettingsWidget(PythonBuildConfiguration *bc)
|
||||
: NamedWidget(Tr::tr("Python"))
|
||||
{
|
||||
using namespace Layouting;
|
||||
m_configureDetailsWidget = new DetailsWidget;
|
||||
@@ -262,6 +260,7 @@ PythonBuildConfiguration::PythonBuildConfiguration(Target *target, const Id &id)
|
||||
, m_buildSystem(std::make_unique<PythonBuildSystem>(this))
|
||||
{
|
||||
setInitializer([this](const BuildInfo &info) { initialize(info); });
|
||||
setConfigWidgetDisplayName(Tr::tr("Python"));
|
||||
|
||||
updateCacheAndEmitEnvironmentChanged();
|
||||
|
||||
@@ -288,7 +287,7 @@ PythonBuildConfiguration::PythonBuildConfiguration(Target *target, const Id &id)
|
||||
&PythonBuildConfiguration::handlePythonUpdated);
|
||||
}
|
||||
|
||||
NamedWidget *PythonBuildConfiguration::createConfigWidget()
|
||||
QWidget *PythonBuildConfiguration::createConfigWidget()
|
||||
{
|
||||
return new PythonBuildSettingsWidget(this);
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ class PythonBuildConfiguration : public ProjectExplorer::BuildConfiguration
|
||||
public:
|
||||
PythonBuildConfiguration(ProjectExplorer::Target *target, const Utils::Id &id);
|
||||
|
||||
ProjectExplorer::NamedWidget *createConfigWidget() override;
|
||||
QWidget *createConfigWidget() override;
|
||||
void fromMap(const Utils::Store &map) override;
|
||||
void toMap(Utils::Store &map) const override;
|
||||
ProjectExplorer::BuildSystem *buildSystem() const override;
|
||||
|
Reference in New Issue
Block a user