forked from qt-creator/qt-creator
Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes, LayoutBuilder and VariableChooser. This is mostly mechanical, with various include/using changes to make it compile. Change-Id: I624a457f3555f102e541c4c71e33a9423af32250 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -14,6 +14,7 @@ add_qtc_library(Utils
|
||||
ansiescapecodehandler.cpp ansiescapecodehandler.h
|
||||
appmainwindow.cpp appmainwindow.h
|
||||
archive.cpp archive.h
|
||||
aspects.cpp aspects.h
|
||||
basetreeview.cpp basetreeview.h
|
||||
benchmarker.cpp benchmarker.h
|
||||
buildablehelperlibrary.cpp buildablehelperlibrary.h
|
||||
@@ -73,6 +74,7 @@ add_qtc_library(Utils
|
||||
itemviews.cpp itemviews.h
|
||||
json.cpp json.h
|
||||
jsontreeitem.cpp jsontreeitem.h
|
||||
layoutbuilder.cpp layoutbuilder.h
|
||||
linecolumn.h
|
||||
link.h
|
||||
listmodel.h
|
||||
@@ -169,6 +171,7 @@ add_qtc_library(Utils
|
||||
utils.qrc
|
||||
utils_global.h
|
||||
utilsicons.cpp utilsicons.h
|
||||
variablechooser.cpp variablechooser.h
|
||||
variant.h
|
||||
winutils.cpp winutils.h
|
||||
wizard.cpp wizard.h
|
||||
|
@@ -23,35 +23,77 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "projectconfigurationaspects.h"
|
||||
#include "aspects.h"
|
||||
|
||||
#include "environmentaspect.h"
|
||||
#include "project.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorersettings.h"
|
||||
#include "runconfiguration.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include "algorithm.h"
|
||||
#include "fancylineedit.h"
|
||||
#include "layoutbuilder.h"
|
||||
#include "pathchooser.h"
|
||||
#include "qtcassert.h"
|
||||
#include "qtcprocess.h"
|
||||
#include "utilsicons.h"
|
||||
#include "variablechooser.h"
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QFormLayout>
|
||||
#include <QSpinBox>
|
||||
#include <QToolButton>
|
||||
#include <QTextEdit>
|
||||
#include <QPointer>
|
||||
#include <QRadioButton>
|
||||
#include <QButtonGroup>
|
||||
#include <QSpinBox>
|
||||
#include <QTextEdit>
|
||||
#include <QToolButton>
|
||||
|
||||
using namespace Utils;
|
||||
namespace Utils {
|
||||
|
||||
// BaseAspect
|
||||
|
||||
BaseAspect::BaseAspect() = default;
|
||||
|
||||
BaseAspect::~BaseAspect() = default;
|
||||
|
||||
void BaseAspect::setConfigWidgetCreator(const ConfigWidgetCreator &configWidgetCreator)
|
||||
{
|
||||
m_configWidgetCreator = configWidgetCreator;
|
||||
}
|
||||
|
||||
QWidget *BaseAspect::createConfigWidget() const
|
||||
{
|
||||
return m_configWidgetCreator ? m_configWidgetCreator() : nullptr;
|
||||
}
|
||||
|
||||
void BaseAspect::addToLayout(LayoutBuilder &)
|
||||
{
|
||||
}
|
||||
|
||||
// BaseAspects
|
||||
|
||||
BaseAspects::BaseAspects() = default;
|
||||
|
||||
BaseAspects::~BaseAspects()
|
||||
{
|
||||
qDeleteAll(base());
|
||||
}
|
||||
|
||||
BaseAspect *BaseAspects::aspect(Utils::Id id) const
|
||||
{
|
||||
return Utils::findOrDefault(base(), Utils::equal(&BaseAspect::id, id));
|
||||
}
|
||||
|
||||
void BaseAspects::fromMap(const QVariantMap &map) const
|
||||
{
|
||||
for (BaseAspect *aspect : *this)
|
||||
aspect->fromMap(map);
|
||||
}
|
||||
|
||||
void BaseAspects::toMap(QVariantMap &map) const
|
||||
{
|
||||
for (BaseAspect *aspect : *this)
|
||||
aspect->toMap(map);
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
class BoolAspectPrivate
|
||||
@@ -108,9 +150,9 @@ public:
|
||||
QPointer<FancyLineEdit> m_lineEditDisplay;
|
||||
QPointer<PathChooser> m_pathChooserDisplay;
|
||||
QPointer<QTextEdit> m_textEditDisplay;
|
||||
Utils::MacroExpanderProvider m_expanderProvider;
|
||||
MacroExpanderProvider m_expanderProvider;
|
||||
QPixmap m_labelPixmap;
|
||||
Utils::FilePath m_baseFileName;
|
||||
FilePath m_baseFileName;
|
||||
StringAspect::ValueAcceptor m_valueAcceptor;
|
||||
bool m_readOnly = false;
|
||||
bool m_showToolTipOnLabel = false;
|
||||
@@ -153,7 +195,7 @@ public:
|
||||
class AspectContainerPrivate
|
||||
{
|
||||
public:
|
||||
QList<ProjectConfigurationAspect *> m_items;
|
||||
QList<BaseAspect *> m_items;
|
||||
};
|
||||
|
||||
class TextDisplayPrivate
|
||||
@@ -168,7 +210,7 @@ public:
|
||||
} // Internal
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::StringAspect
|
||||
\class Utils::StringAspect
|
||||
*/
|
||||
|
||||
StringAspect::StringAspect()
|
||||
@@ -382,17 +424,19 @@ void StringAspect::addToLayout(LayoutBuilder &builder)
|
||||
d->m_label->setPixmap(d->m_labelPixmap);
|
||||
builder.addItem(d->m_label.data());
|
||||
|
||||
QWidget *parentWidget = builder.layout()->parentWidget();
|
||||
|
||||
const auto useMacroExpander = [this, &builder](QWidget *w) {
|
||||
if (!d->m_expanderProvider)
|
||||
return;
|
||||
const auto chooser = new Core::VariableChooser(builder.layout()->parentWidget());
|
||||
const auto chooser = new VariableChooser(builder.layout()->parentWidget());
|
||||
chooser->addSupportedWidget(w);
|
||||
chooser->addMacroExpanderProvider(d->m_expanderProvider);
|
||||
};
|
||||
|
||||
switch (d->m_displayStyle) {
|
||||
case PathChooserDisplay:
|
||||
d->m_pathChooserDisplay = new PathChooser;
|
||||
d->m_pathChooserDisplay = new PathChooser(parentWidget);
|
||||
d->m_pathChooserDisplay->setExpectedKind(d->m_expectedKind);
|
||||
if (!d->m_historyCompleterKey.isEmpty())
|
||||
d->m_pathChooserDisplay->setHistoryCompleter(d->m_historyCompleterKey);
|
||||
@@ -501,7 +545,7 @@ void StringAspect::makeCheckable(CheckBoxPlacement checkBoxPlacement,
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::BoolAspect
|
||||
\class Utils::BoolAspect
|
||||
*/
|
||||
|
||||
BoolAspect::BoolAspect(const QString &settingsKey)
|
||||
@@ -592,7 +636,7 @@ void BoolAspect::setEnabled(bool enabled)
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::SelectionAspect
|
||||
\class Utils::SelectionAspect
|
||||
*/
|
||||
|
||||
SelectionAspect::SelectionAspect()
|
||||
@@ -706,7 +750,7 @@ void SelectionAspect::addOption(const QString &displayName, const QString &toolT
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::IntegerAspect
|
||||
\class Utils::IntegerAspect
|
||||
*/
|
||||
|
||||
// IntegerAspect
|
||||
@@ -821,7 +865,7 @@ void IntegerAspect::setToolTip(const QString &tooltip)
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::BaseTristateAspect
|
||||
\class Utils::BaseTristateAspect
|
||||
*/
|
||||
|
||||
TriStateAspect::TriStateAspect()
|
||||
@@ -856,7 +900,7 @@ TriState TriState::fromVariant(const QVariant &variant)
|
||||
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::StringListAspect
|
||||
\class Utils::StringListAspect
|
||||
*/
|
||||
|
||||
StringListAspect::StringListAspect()
|
||||
@@ -892,7 +936,7 @@ void StringListAspect::setValue(const QStringList &value)
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::TextDisplay
|
||||
\class Utils::TextDisplay
|
||||
*/
|
||||
|
||||
TextDisplay::TextDisplay(const QString &message, InfoLabel::InfoType type)
|
||||
@@ -919,7 +963,7 @@ void TextDisplay::addToLayout(LayoutBuilder &builder)
|
||||
|
||||
void TextDisplay::setVisible(bool visible)
|
||||
{
|
||||
ProjectConfigurationAspect::setVisible(visible);
|
||||
BaseAspect::setVisible(visible);
|
||||
if (d->m_label)
|
||||
d->m_label->setVisible(visible);
|
||||
}
|
||||
@@ -939,7 +983,7 @@ void TextDisplay::setIconType(InfoLabel::InfoType t)
|
||||
}
|
||||
|
||||
/*!
|
||||
\class ProjectExplorer::AspectContainer
|
||||
\class Utils::AspectContainer
|
||||
*/
|
||||
|
||||
AspectContainer::AspectContainer()
|
||||
@@ -948,14 +992,14 @@ AspectContainer::AspectContainer()
|
||||
|
||||
AspectContainer::~AspectContainer() = default;
|
||||
|
||||
void AspectContainer::addAspectHelper(ProjectConfigurationAspect *aspect)
|
||||
void AspectContainer::addAspectHelper(BaseAspect *aspect)
|
||||
{
|
||||
d->m_items.append(aspect);
|
||||
}
|
||||
|
||||
void AspectContainer::addToLayout(LayoutBuilder &builder)
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : d->m_items) {
|
||||
for (BaseAspect *aspect : d->m_items) {
|
||||
if (aspect->isVisible())
|
||||
aspect->addToLayout(builder);
|
||||
}
|
||||
@@ -963,14 +1007,14 @@ void AspectContainer::addToLayout(LayoutBuilder &builder)
|
||||
|
||||
void AspectContainer::fromMap(const QVariantMap &map)
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : d->m_items)
|
||||
for (BaseAspect *aspect : d->m_items)
|
||||
aspect->fromMap(map);
|
||||
}
|
||||
|
||||
void AspectContainer::toMap(QVariantMap &map) const
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : d->m_items)
|
||||
for (BaseAspect *aspect : d->m_items)
|
||||
aspect->toMap(map);
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
} // namespace Utils
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
@@ -25,17 +25,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "projectconfiguration.h"
|
||||
#include "environmentaspect.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/infolabel.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include "fileutils.h"
|
||||
#include "id.h"
|
||||
#include "infolabel.h"
|
||||
#include "macroexpander.h"
|
||||
#include "optional.h"
|
||||
#include "pathchooser.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Utils {
|
||||
|
||||
class BaseAspects;
|
||||
class LayoutBuilder;
|
||||
|
||||
namespace Internal {
|
||||
class AspectContainerPrivate;
|
||||
@@ -47,7 +49,91 @@ class StringListAspectPrivate;
|
||||
class TextDisplayPrivate;
|
||||
} // Internal
|
||||
|
||||
class PROJECTEXPLORER_EXPORT BoolAspect : public ProjectConfigurationAspect
|
||||
class QTCREATOR_UTILS_EXPORT BaseAspect : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BaseAspect();
|
||||
~BaseAspect() override;
|
||||
|
||||
void setId(Utils::Id id) { m_id = id; }
|
||||
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
||||
void setSettingsKey(const QString &settingsKey) { m_settingsKey = settingsKey; }
|
||||
|
||||
Utils::Id id() const { return m_id; }
|
||||
QString displayName() const { return m_displayName; }
|
||||
QString settingsKey() const { return m_settingsKey; }
|
||||
|
||||
bool isVisible() const { return m_visible; }
|
||||
void setVisible(bool visible) { m_visible = visible; }
|
||||
|
||||
using ConfigWidgetCreator = std::function<QWidget *()>;
|
||||
void setConfigWidgetCreator(const ConfigWidgetCreator &configWidgetCreator);
|
||||
QWidget *createConfigWidget() const;
|
||||
|
||||
virtual void fromMap(const QVariantMap &) {}
|
||||
virtual void toMap(QVariantMap &) const {}
|
||||
virtual void acquaintSiblings(const BaseAspects &) {}
|
||||
|
||||
virtual void addToLayout(LayoutBuilder &builder);
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
protected:
|
||||
virtual void setVisibleDynamic(bool visible) { Q_UNUSED(visible) } // TODO: Better name? Merge with setVisible() somehow?
|
||||
|
||||
Utils::Id m_id;
|
||||
QString m_displayName;
|
||||
QString m_settingsKey; // Name of data in settings.
|
||||
bool m_visible = true;
|
||||
ConfigWidgetCreator m_configWidgetCreator;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT BaseAspects
|
||||
: private QList<BaseAspect *>
|
||||
{
|
||||
using Base = QList<BaseAspect *>;
|
||||
|
||||
BaseAspects(const BaseAspects &) = delete;
|
||||
BaseAspects &operator=(const BaseAspects &) = delete;
|
||||
|
||||
public:
|
||||
BaseAspects();
|
||||
~BaseAspects();
|
||||
|
||||
template <class Aspect, typename ...Args>
|
||||
Aspect *addAspect(Args && ...args)
|
||||
{
|
||||
auto aspect = new Aspect(args...);
|
||||
append(aspect);
|
||||
return aspect;
|
||||
}
|
||||
|
||||
BaseAspect *aspect(Utils::Id id) const;
|
||||
|
||||
template <typename T> T *aspect() const
|
||||
{
|
||||
for (BaseAspect *aspect : *this)
|
||||
if (T *result = qobject_cast<T *>(aspect))
|
||||
return result;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void fromMap(const QVariantMap &map) const;
|
||||
void toMap(QVariantMap &map) const;
|
||||
|
||||
using Base::append;
|
||||
using Base::begin;
|
||||
using Base::end;
|
||||
|
||||
private:
|
||||
Base &base() { return *this; }
|
||||
const Base &base() const { return *this; }
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT BoolAspect : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -76,7 +162,7 @@ private:
|
||||
std::unique_ptr<Internal::BoolAspectPrivate> d;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT SelectionAspect : public ProjectConfigurationAspect
|
||||
class QTCREATOR_UTILS_EXPORT SelectionAspect : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -111,7 +197,7 @@ private:
|
||||
std::unique_ptr<Internal::SelectionAspectPrivate> d;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT StringAspect : public ProjectConfigurationAspect
|
||||
class QTCREATOR_UTILS_EXPORT StringAspect : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -176,7 +262,7 @@ private:
|
||||
std::unique_ptr<Internal::StringAspectPrivate> d;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IntegerAspect : public ProjectConfigurationAspect
|
||||
class QTCREATOR_UTILS_EXPORT IntegerAspect : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -206,7 +292,7 @@ private:
|
||||
std::unique_ptr<Internal::IntegerAspectPrivate> d;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT TriState
|
||||
class QTCREATOR_UTILS_EXPORT TriState
|
||||
{
|
||||
enum Value { EnabledValue, DisabledValue, DefaultValue };
|
||||
explicit TriState(Value v) : m_value(v) {}
|
||||
@@ -228,7 +314,7 @@ private:
|
||||
Value m_value = DefaultValue;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT TriStateAspect : public SelectionAspect
|
||||
class QTCREATOR_UTILS_EXPORT TriStateAspect : public SelectionAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -238,7 +324,7 @@ public:
|
||||
void setSetting(TriState setting);
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT StringListAspect : public ProjectConfigurationAspect
|
||||
class QTCREATOR_UTILS_EXPORT StringListAspect : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -258,7 +344,7 @@ private:
|
||||
std::unique_ptr<Internal::StringListAspectPrivate> d;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT TextDisplay : public ProjectConfigurationAspect
|
||||
class QTCREATOR_UTILS_EXPORT TextDisplay : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -277,7 +363,7 @@ private:
|
||||
std::unique_ptr<Internal::TextDisplayPrivate> d;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT AspectContainer : public ProjectConfigurationAspect
|
||||
class QTCREATOR_UTILS_EXPORT AspectContainer : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -299,17 +385,9 @@ public:
|
||||
void toMap(QVariantMap &map) const override;
|
||||
|
||||
private:
|
||||
void addAspectHelper(ProjectConfigurationAspect *aspect);
|
||||
void addAspectHelper(BaseAspect *aspect);
|
||||
|
||||
std::unique_ptr<Internal::AspectContainerPrivate> d;
|
||||
};
|
||||
|
||||
// FIXME: For migration. Remove after 4.15
|
||||
using BaseBoolAspect = BoolAspect;
|
||||
using BaseIntegerAspect = IntegerAspect;
|
||||
using BaseSelectionAspect = SelectionAspect;
|
||||
using BaseStringAspect = StringAspect;
|
||||
using BaseStringListAspect = StringListAspect;
|
||||
using BaseStringListAspect = StringListAspect;
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
} // namespace Utils
|
160
src/libs/utils/layoutbuilder.cpp
Normal file
160
src/libs/utils/layoutbuilder.cpp
Normal file
@@ -0,0 +1,160 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "layoutbuilder.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QGridLayout>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
LayoutBuilder::LayoutBuilder(QWidget *parent, LayoutType layoutType)
|
||||
{
|
||||
if (layoutType == FormLayout) {
|
||||
m_formLayout = new QFormLayout(parent);
|
||||
m_formLayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||
} else {
|
||||
m_gridLayout = new QGridLayout(parent);
|
||||
m_gridLayout->setContentsMargins(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LayoutBuilder::LayoutBuilder(QLayout *layout)
|
||||
{
|
||||
if (auto fl = qobject_cast<QFormLayout *>(layout)) {
|
||||
m_formLayout = fl;
|
||||
} else if (auto grid = qobject_cast<QGridLayout *>(layout)) {
|
||||
m_gridLayout = grid;
|
||||
m_currentGridRow = grid->rowCount();
|
||||
m_currentGridColumn = 0;
|
||||
}
|
||||
}
|
||||
|
||||
LayoutBuilder::~LayoutBuilder()
|
||||
{
|
||||
flushPendingFormItems();
|
||||
}
|
||||
|
||||
LayoutBuilder &LayoutBuilder::startNewRow()
|
||||
{
|
||||
if (m_formLayout)
|
||||
flushPendingFormItems();
|
||||
if (m_gridLayout) {
|
||||
if (m_currentGridColumn != 0) {
|
||||
++m_currentGridRow;
|
||||
m_currentGridColumn = 0;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
LayoutBuilder &LayoutBuilder::addRow(const LayoutItem &item)
|
||||
{
|
||||
startNewRow();
|
||||
addItem(item);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void LayoutBuilder::flushPendingFormItems()
|
||||
{
|
||||
QTC_ASSERT(m_formLayout, return);
|
||||
|
||||
if (m_pendingFormItems.isEmpty())
|
||||
return;
|
||||
|
||||
// If there are more than two items, we cram the last ones in one hbox.
|
||||
if (m_pendingFormItems.size() > 2) {
|
||||
auto hbox = new QHBoxLayout;
|
||||
hbox->setContentsMargins(0, 0, 0, 0);
|
||||
for (int i = 1; i < m_pendingFormItems.size(); ++i) {
|
||||
if (QWidget *w = m_pendingFormItems.at(i).widget)
|
||||
hbox->addWidget(w);
|
||||
else if (QLayout *l = m_pendingFormItems.at(i).layout)
|
||||
hbox->addItem(l);
|
||||
else
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
while (m_pendingFormItems.size() >= 2)
|
||||
m_pendingFormItems.takeLast();
|
||||
m_pendingFormItems.append(LayoutItem(hbox));
|
||||
}
|
||||
|
||||
if (m_pendingFormItems.size() == 1) { // One one item given, so this spans both columns.
|
||||
if (auto layout = m_pendingFormItems.at(0).layout)
|
||||
m_formLayout->addRow(layout);
|
||||
else if (auto widget = m_pendingFormItems.at(0).widget)
|
||||
m_formLayout->addRow(widget);
|
||||
} else if (m_pendingFormItems.size() == 2) { // Normal case, both columns used.
|
||||
if (auto label = m_pendingFormItems.at(0).widget) {
|
||||
if (auto layout = m_pendingFormItems.at(1).layout)
|
||||
m_formLayout->addRow(label, layout);
|
||||
else if (auto widget = m_pendingFormItems.at(1).widget)
|
||||
m_formLayout->addRow(label, widget);
|
||||
} else {
|
||||
if (auto layout = m_pendingFormItems.at(1).layout)
|
||||
m_formLayout->addRow(m_pendingFormItems.at(0).text, layout);
|
||||
else if (auto widget = m_pendingFormItems.at(1).widget)
|
||||
m_formLayout->addRow(m_pendingFormItems.at(0).text, widget);
|
||||
}
|
||||
} else {
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
m_pendingFormItems.clear();
|
||||
}
|
||||
|
||||
QLayout *LayoutBuilder::layout() const
|
||||
{
|
||||
if (m_formLayout)
|
||||
return m_formLayout;
|
||||
return m_gridLayout;
|
||||
}
|
||||
|
||||
LayoutBuilder &LayoutBuilder::addItem(LayoutItem item)
|
||||
{
|
||||
if (item.widget && !item.widget->parent())
|
||||
item.widget->setParent(layout()->parentWidget());
|
||||
|
||||
if (item.aspect) {
|
||||
item.aspect->addToLayout(*this);
|
||||
} else {
|
||||
if (m_gridLayout) {
|
||||
if (auto widget = item.widget)
|
||||
m_gridLayout->addWidget(widget, m_currentGridRow, m_currentGridColumn, 1, item.span, item.align);
|
||||
m_currentGridColumn += item.span;
|
||||
} else {
|
||||
m_pendingFormItems.append(item);
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
} // Utils
|
92
src/libs/utils/layoutbuilder.h
Normal file
92
src/libs/utils/layoutbuilder.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFormLayout;
|
||||
class QGridLayout;
|
||||
class QLayout;
|
||||
class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class BaseAspect;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT LayoutBuilder
|
||||
{
|
||||
public:
|
||||
enum LayoutType { GridLayout, FormLayout };
|
||||
explicit LayoutBuilder(QWidget *parent, LayoutType layoutType = FormLayout);
|
||||
explicit LayoutBuilder(QLayout *layout); // Adds to existing layout.
|
||||
|
||||
~LayoutBuilder();
|
||||
|
||||
class LayoutItem
|
||||
{
|
||||
public:
|
||||
LayoutItem(QLayout *layout, int span = 1) : layout(layout), span(span) {}
|
||||
LayoutItem(QWidget *widget, int span = 1, Qt::Alignment align = {})
|
||||
: widget(widget), span(span), align(align) {}
|
||||
LayoutItem(BaseAspect *aspect) : aspect(aspect) {}
|
||||
LayoutItem(const QString &text) : text(text) {}
|
||||
|
||||
QLayout *layout = nullptr;
|
||||
QWidget *widget = nullptr;
|
||||
BaseAspect *aspect = nullptr;
|
||||
QString text;
|
||||
int span = 1;
|
||||
Qt::Alignment align;
|
||||
};
|
||||
|
||||
template<typename ...Items>
|
||||
LayoutBuilder &addItems(LayoutItem first, Items... rest) {
|
||||
return addItem(first).addItems(rest...);
|
||||
}
|
||||
LayoutBuilder &addItems() { return *this; }
|
||||
LayoutBuilder &addItem(LayoutItem item);
|
||||
|
||||
LayoutBuilder &startNewRow();
|
||||
LayoutBuilder &addRow(const LayoutItem &item);
|
||||
|
||||
QLayout *layout() const;
|
||||
|
||||
private:
|
||||
void flushPendingFormItems();
|
||||
|
||||
QFormLayout *m_formLayout = nullptr;
|
||||
QGridLayout *m_gridLayout = nullptr;
|
||||
QList<LayoutItem> m_pendingFormItems;
|
||||
int m_currentGridRow = 0;
|
||||
int m_currentGridColumn = 0;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
@@ -195,7 +195,7 @@ using namespace Internal;
|
||||
|
||||
If the string that you want to parametrize is settable by the user, through a QLineEdit or
|
||||
QTextEdit derived class, you should add a variable chooser to your UI, which allows adding
|
||||
variables to the string by browsing through a list. See Core::VariableChooser for more
|
||||
variables to the string by browsing through a list. See Utils::VariableChooser for more
|
||||
details.
|
||||
|
||||
\section2 Expanding Strings
|
||||
|
@@ -138,7 +138,10 @@ SOURCES += \
|
||||
$$PWD/overlaywidget.cpp \
|
||||
$$PWD/archive.cpp \
|
||||
$$PWD/id.cpp \
|
||||
$$PWD/infobar.cpp
|
||||
$$PWD/infobar.cpp \
|
||||
$$PWD/aspects.cpp \
|
||||
$$PWD/layoutbuilder.cpp \
|
||||
$$PWD/variablechooser.cpp
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/environmentfwd.h \
|
||||
@@ -292,7 +295,10 @@ HEADERS += \
|
||||
$$PWD/archive.h \
|
||||
$$PWD/id.h \
|
||||
$$PWD/infobar.h \
|
||||
$$PWD/porting.h
|
||||
$$PWD/porting.h \
|
||||
$$PWD/aspects.h \
|
||||
$$PWD/layoutbuilder.h \
|
||||
$$PWD/variablechooser.h
|
||||
|
||||
FORMS += $$PWD/filewizardpage.ui \
|
||||
$$PWD/projectintropage.ui \
|
||||
|
@@ -46,6 +46,8 @@ Project {
|
||||
"appmainwindow.h",
|
||||
"archive.cpp",
|
||||
"archive.h",
|
||||
"aspects.cpp",
|
||||
"aspects.h",
|
||||
"basetreeview.cpp",
|
||||
"basetreeview.h",
|
||||
"benchmarker.cpp",
|
||||
@@ -155,6 +157,8 @@ Project {
|
||||
"json.h",
|
||||
"jsontreeitem.cpp",
|
||||
"jsontreeitem.h",
|
||||
"layoutbuilder.cpp",
|
||||
"layoutbuilder.h",
|
||||
"linecolumn.h",
|
||||
"link.h",
|
||||
"listmodel.h",
|
||||
@@ -292,6 +296,8 @@ Project {
|
||||
"utils_global.h",
|
||||
"utilsicons.h",
|
||||
"utilsicons.cpp",
|
||||
"variablechooser.cpp",
|
||||
"variablechooser.h",
|
||||
"variant.h",
|
||||
"../3rdparty/variant/variant.hpp",
|
||||
"winutils.cpp",
|
||||
|
@@ -24,14 +24,13 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "variablechooser.h"
|
||||
#include "coreconstants.h"
|
||||
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/headerviewstretcher.h> // IconButton
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/treemodel.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include "fancylineedit.h"
|
||||
#include "headerviewstretcher.h" // IconButton
|
||||
#include "macroexpander.h"
|
||||
#include "treemodel.h"
|
||||
#include "qtcassert.h"
|
||||
#include "utilsicons.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QAbstractItemModel>
|
||||
@@ -50,9 +49,7 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QVector>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
namespace Internal {
|
||||
|
||||
enum {
|
||||
@@ -339,7 +336,7 @@ void VariableGroupItem::populateGroup(MacroExpander *expander)
|
||||
using namespace Internal;
|
||||
|
||||
/*!
|
||||
\class Core::VariableChooser
|
||||
\class Utils::VariableChooser
|
||||
\inheaderfile coreplugin/variablechooser.h
|
||||
\inmodule QtCreator
|
||||
|
||||
@@ -366,10 +363,10 @@ using namespace Internal;
|
||||
Example:
|
||||
\code
|
||||
QWidget *myOptionsContainerWidget = new QWidget;
|
||||
new Core::VariableChooser(myOptionsContainerWidget)
|
||||
new Utils::VariableChooser(myOptionsContainerWidget)
|
||||
QLineEdit *myLineEditOption = new QLineEdit(myOptionsContainerWidget);
|
||||
myOptionsContainerWidget->layout()->addWidget(myLineEditOption);
|
||||
Core::VariableChooser::addVariableSupport(myLineEditOption);
|
||||
Utils::VariableChooser::addVariableSupport(myLineEditOption);
|
||||
\endcode
|
||||
*/
|
||||
|
@@ -25,18 +25,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core_global.h"
|
||||
#include "utils_global.h"
|
||||
#include "macroexpander.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <utils/macroexpander.h>
|
||||
#include <functional>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
|
||||
namespace Internal { class VariableChooserPrivate; }
|
||||
|
||||
class CORE_EXPORT VariableChooser : public QWidget
|
||||
class QTCREATOR_UTILS_EXPORT VariableChooser : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -57,4 +57,4 @@ private:
|
||||
Internal::VariableChooserPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
} // namespace Utils
|
@@ -41,11 +41,11 @@
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpacerItem>
|
||||
@@ -114,7 +114,7 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Utils::Id id)
|
||||
|
||||
auto extraAppArgsAspect = addAspect<ArgumentsAspect>();
|
||||
|
||||
connect(extraAppArgsAspect, &ProjectConfigurationAspect::changed,
|
||||
connect(extraAppArgsAspect, &BaseAspect::changed,
|
||||
this, [target, extraAppArgsAspect]() {
|
||||
if (target->buildConfigurations().first()->buildType() == BuildConfiguration::BuildType::Release) {
|
||||
const QString buildKey = target->activeBuildKey();
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
namespace Android {
|
||||
|
||||
class BaseStringListAspect : public ProjectExplorer::ProjectConfigurationAspect
|
||||
class BaseStringListAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
Utils::Id id = Utils::Id());
|
||||
~BaseStringListAspect() override;
|
||||
|
||||
void addToLayout(ProjectExplorer::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
|
||||
QStringList value() const;
|
||||
void setValue(const QStringList &val);
|
||||
|
@@ -32,10 +32,12 @@
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -80,7 +82,7 @@ AutogenStep::AutogenStep(BuildStepList *bsl, Utils::Id id) : AbstractProcessStep
|
||||
m_additionalArgumentsAspect->setDisplayStyle(StringAspect::LineEditDisplay);
|
||||
m_additionalArgumentsAspect->setHistoryCompleter("AutotoolsPM.History.AutogenStepArgs");
|
||||
|
||||
connect(m_additionalArgumentsAspect, &ProjectConfigurationAspect::changed, this, [this] {
|
||||
connect(m_additionalArgumentsAspect, &BaseAspect::changed, this, [this] {
|
||||
m_runAutogen = true;
|
||||
});
|
||||
|
||||
|
@@ -33,10 +33,13 @@
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace AutotoolsProjectManager {
|
||||
namespace Internal {
|
||||
@@ -78,7 +81,7 @@ AutoreconfStep::AutoreconfStep(BuildStepList *bsl, Utils::Id id)
|
||||
m_additionalArgumentsAspect->setDisplayStyle(StringAspect::LineEditDisplay);
|
||||
m_additionalArgumentsAspect->setHistoryCompleter("AutotoolsPM.History.AutoreconfStepArgs");
|
||||
|
||||
connect(m_additionalArgumentsAspect, &ProjectConfigurationAspect::changed, this, [this] {
|
||||
connect(m_additionalArgumentsAspect, &BaseAspect::changed, this, [this] {
|
||||
m_runAutoreconf = true;
|
||||
});
|
||||
|
||||
|
@@ -32,10 +32,12 @@
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
|
||||
@@ -84,7 +86,7 @@ public:
|
||||
private:
|
||||
void doRun() override;
|
||||
|
||||
ProjectExplorer::StringAspect *m_additionalArgumentsAspect = nullptr;
|
||||
StringAspect *m_additionalArgumentsAspect = nullptr;
|
||||
bool m_runConfigure = false;
|
||||
};
|
||||
|
||||
@@ -100,7 +102,7 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl, Utils::Id id)
|
||||
m_additionalArgumentsAspect->setLabelText(tr("Arguments:"));
|
||||
m_additionalArgumentsAspect->setHistoryCompleter("AutotoolsPM.History.ConfigureArgs");
|
||||
|
||||
connect(m_additionalArgumentsAspect, &ProjectConfigurationAspect::changed, this, [this] {
|
||||
connect(m_additionalArgumentsAspect, &BaseAspect::changed, this, [this] {
|
||||
m_runConfigure = true;
|
||||
});
|
||||
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "debugserverproviderchooser.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <utils/variablechooser.h>
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
|
@@ -28,11 +28,10 @@
|
||||
#include <baremetal/baremetalconstants.h>
|
||||
#include <baremetal/debugserverprovidermanager.h>
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
@@ -297,7 +296,7 @@ EBlinkGdbServerProviderConfigWidget::EBlinkGdbServerProviderConfigWidget(
|
||||
addErrorLabel();
|
||||
setFromProvider();
|
||||
|
||||
const auto chooser = new Core::VariableChooser(this);
|
||||
const auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_initCommandsTextEdit);
|
||||
chooser->addSupportedWidget(m_resetCommandsTextEdit);
|
||||
|
||||
|
@@ -28,12 +28,11 @@
|
||||
#include <baremetal/baremetalconstants.h>
|
||||
#include <baremetal/debugserverprovidermanager.h>
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QFormLayout>
|
||||
@@ -271,12 +270,10 @@ JLinkGdbServerProviderConfigWidget::JLinkGdbServerProviderConfigWidget(
|
||||
m_resetCommandsTextEdit->setToolTip(defaultResetCommandsTooltip());
|
||||
m_mainLayout->addRow(tr("Reset commands:"), m_resetCommandsTextEdit);
|
||||
|
||||
|
||||
|
||||
addErrorLabel();
|
||||
setFromProvider();
|
||||
|
||||
const auto chooser = new Core::VariableChooser(this);
|
||||
const auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_initCommandsTextEdit);
|
||||
chooser->addSupportedWidget(m_resetCommandsTextEdit);
|
||||
|
||||
|
@@ -28,12 +28,11 @@
|
||||
#include <baremetal/baremetalconstants.h>
|
||||
#include <baremetal/debugserverprovidermanager.h>
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QFormLayout>
|
||||
@@ -230,7 +229,7 @@ OpenOcdGdbServerProviderConfigWidget::OpenOcdGdbServerProviderConfigWidget(
|
||||
addErrorLabel();
|
||||
setFromProvider();
|
||||
|
||||
const auto chooser = new Core::VariableChooser(this);
|
||||
const auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_initCommandsTextEdit);
|
||||
chooser->addSupportedWidget(m_resetCommandsTextEdit);
|
||||
|
||||
|
@@ -28,11 +28,10 @@
|
||||
#include <baremetal/baremetalconstants.h>
|
||||
#include <baremetal/debugserverprovidermanager.h>
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
@@ -222,7 +221,7 @@ StLinkUtilGdbServerProviderConfigWidget::StLinkUtilGdbServerProviderConfigWidget
|
||||
addErrorLabel();
|
||||
setFromProvider();
|
||||
|
||||
const auto chooser = new Core::VariableChooser(this);
|
||||
const auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_initCommandsTextEdit);
|
||||
chooser->addSupportedWidget(m_resetCommandsTextEdit);
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <remotelinux/abstractremotelinuxdeploystep.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Qdb {
|
||||
namespace Internal {
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
@@ -126,7 +126,7 @@ private:
|
||||
friend class CMakeProjectImporter;
|
||||
};
|
||||
|
||||
class InitialCMakeArgumentsAspect final : public ProjectExplorer::StringAspect
|
||||
class InitialCMakeArgumentsAspect final : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include <utils/headerviewstretcher.h>
|
||||
#include <utils/infolabel.h>
|
||||
#include <utils/itemviews.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/progressindicator.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -54,6 +55,7 @@
|
||||
#include <QMenu>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
namespace Internal {
|
||||
@@ -100,7 +102,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
|
||||
int row = 0;
|
||||
auto buildDirAspect = bc->buildDirectoryAspect();
|
||||
connect(buildDirAspect, &ProjectConfigurationAspect::changed, this, [this]() {
|
||||
connect(buildDirAspect, &BaseAspect::changed, this, [this]() {
|
||||
m_configModel->flush(); // clear out config cache...;
|
||||
});
|
||||
auto initialCMakeAspect = bc->aspect<InitialCMakeArgumentsAspect>();
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QListWidget>
|
||||
|
@@ -28,9 +28,10 @@
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <utils/treemodel.h>
|
||||
|
||||
namespace Utils { class CommandLine; }
|
||||
|
||||
namespace ProjectExplorer { class StringAspect; }
|
||||
namespace Utils {
|
||||
class CommandLine;
|
||||
class StringAspect;
|
||||
} // Utils
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
namespace Internal {
|
||||
@@ -103,8 +104,8 @@ private:
|
||||
|
||||
friend class CMakeBuildStepConfigWidget;
|
||||
QStringList m_buildTargets; // Convention: Empty string member signifies "Current executable"
|
||||
ProjectExplorer::StringAspect *m_cmakeArguments = nullptr;
|
||||
ProjectExplorer::StringAspect *m_toolArguments = nullptr;
|
||||
Utils::StringAspect *m_cmakeArguments = nullptr;
|
||||
Utils::StringAspect *m_toolArguments = nullptr;
|
||||
bool m_waiting = false;
|
||||
|
||||
Utils::TreeModel<Utils::TreeItem, CMakeTargetItem> m_buildTargetModel;
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include "cmaketoolmanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorersettings.h>
|
||||
@@ -49,6 +48,7 @@
|
||||
#include <utils/environment.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDialog>
|
||||
@@ -877,7 +877,7 @@ private:
|
||||
"You may provide a type hint by adding \":TYPE\" before the \"=\"."));
|
||||
m_editor->setMinimumSize(800, 200);
|
||||
|
||||
auto chooser = new Core::VariableChooser(m_dialog);
|
||||
auto chooser = new Utils::VariableChooser(m_dialog);
|
||||
chooser->addSupportedWidget(m_editor);
|
||||
chooser->addMacroExpanderProvider([this]() { return kit()->macroExpander(); });
|
||||
|
||||
|
@@ -146,7 +146,6 @@ add_qtc_plugin(Core
|
||||
systemsettings.cpp systemsettings.h systemsettings.ui
|
||||
textdocument.cpp textdocument.h
|
||||
themechooser.cpp themechooser.h
|
||||
variablechooser.cpp variablechooser.h
|
||||
vcsmanager.cpp vcsmanager.h
|
||||
versiondialog.cpp versiondialog.h
|
||||
welcomepagehelper.cpp welcomepagehelper.h
|
||||
|
@@ -86,7 +86,6 @@ SOURCES += corejsextensions.cpp \
|
||||
externaltool.cpp \
|
||||
dialogs/externaltoolconfig.cpp \
|
||||
dialogs/filepropertiesdialog.cpp \
|
||||
variablechooser.cpp \
|
||||
mimetypemagicdialog.cpp \
|
||||
mimetypesettings.cpp \
|
||||
dialogs/promptoverwritedialog.cpp \
|
||||
@@ -201,7 +200,6 @@ HEADERS += corejsextensions.h \
|
||||
externaltool.h \
|
||||
dialogs/externaltoolconfig.h \
|
||||
dialogs/filepropertiesdialog.h \
|
||||
variablechooser.h \
|
||||
mimetypemagicdialog.h \
|
||||
mimetypesettings.h \
|
||||
dialogs/promptoverwritedialog.h \
|
||||
|
@@ -175,8 +175,6 @@ Project {
|
||||
"textdocument.h",
|
||||
"themechooser.cpp",
|
||||
"themechooser.h",
|
||||
"variablechooser.cpp",
|
||||
"variablechooser.h",
|
||||
"vcsmanager.cpp",
|
||||
"vcsmanager.h",
|
||||
"versiondialog.cpp",
|
||||
|
@@ -36,12 +36,12 @@
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/externaltool.h>
|
||||
#include <coreplugin/externaltoolmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QDir>
|
||||
|
@@ -32,9 +32,9 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <debugger/analyzer/analyzericons.h>
|
||||
|
||||
@@ -66,7 +66,7 @@ OptionsWidget::OptionsWidget(QWidget *parent)
|
||||
m_binary->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
||||
m_binary->setCommandVersionArguments({"--version"});
|
||||
|
||||
auto variableChooser = new Core::VariableChooser(this);
|
||||
auto variableChooser = new Utils::VariableChooser(this);
|
||||
variableChooser->addSupportedWidget (m_customArguments);
|
||||
|
||||
m_unusedFunction->setToolTip(tr("Disables multithreaded check."));
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include "debuggersourcepathmappingwidget.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <app/app_version.h>
|
||||
|
||||
@@ -39,6 +38,7 @@
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QCoreApplication>
|
||||
|
@@ -40,14 +40,17 @@
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtbuildaspects.h>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDebug>
|
||||
#include <QFormLayout>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Debugger::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
@@ -58,7 +61,7 @@ enum DebuggerLanguageStatus {
|
||||
AutoEnabledLanguage
|
||||
};
|
||||
|
||||
class DebuggerLanguageAspect : public ProjectConfigurationAspect
|
||||
class DebuggerLanguageAspect : public BaseAspect
|
||||
{
|
||||
public:
|
||||
DebuggerLanguageAspect() = default;
|
||||
|
@@ -59,8 +59,8 @@ public:
|
||||
private:
|
||||
Internal::DebuggerLanguageAspect *m_cppAspect;
|
||||
Internal::DebuggerLanguageAspect *m_qmlAspect;
|
||||
ProjectExplorer::BoolAspect *m_multiProcessAspect;
|
||||
ProjectExplorer::StringAspect *m_overrideStartupAspect;
|
||||
Utils::BoolAspect *m_multiProcessAspect;
|
||||
Utils::StringAspect *m_overrideStartupAspect;
|
||||
ProjectExplorer::Target *m_target;
|
||||
};
|
||||
|
||||
|
@@ -26,14 +26,13 @@
|
||||
#include "debuggersourcepathmappingwidget.h"
|
||||
#include "debuggerengine.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/buildablehelperlibrary.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QStandardItemModel>
|
||||
#include <QTreeView>
|
||||
@@ -276,7 +275,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent
|
||||
editLayout->addRow(editTargetLabel, m_targetChooser);
|
||||
editLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||
|
||||
auto chooser = new Core::VariableChooser(this);
|
||||
auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_targetChooser->lineEdit());
|
||||
|
||||
// Main layout
|
||||
|
@@ -31,11 +31,11 @@
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QCoreApplication>
|
||||
|
@@ -32,13 +32,13 @@
|
||||
#include <projectexplorer/buildinfo.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
|
@@ -33,9 +33,10 @@
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include <projectexplorer/project.h>
|
||||
|
||||
#include <utils/environment.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
|
@@ -26,7 +26,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPointer>
|
||||
@@ -34,7 +35,7 @@
|
||||
namespace IncrediBuild {
|
||||
namespace Internal {
|
||||
|
||||
class CommandBuilderAspect final : public ProjectExplorer::ProjectConfigurationAspect
|
||||
class CommandBuilderAspect final : public Utils::BaseAspect
|
||||
{
|
||||
public:
|
||||
explicit CommandBuilderAspect(ProjectExplorer::BuildStep *step);
|
||||
@@ -43,7 +44,7 @@ public:
|
||||
QString fullCommandFlag(bool keepJobNum) const;
|
||||
|
||||
private:
|
||||
void addToLayout(ProjectExplorer::LayoutBuilder &builder) final;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) final;
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
|
||||
|
@@ -33,9 +33,11 @@
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
|
@@ -47,6 +47,7 @@
|
||||
|
||||
using namespace QmakeProjectManager;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "qmakeprojectmanager/qmakebuildconfiguration.h"
|
||||
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
@@ -46,8 +46,8 @@ private:
|
||||
|
||||
void updateQmakeCommand();
|
||||
|
||||
ProjectExplorer::StringAspect *m_signingIdentifier = nullptr;
|
||||
ProjectExplorer::BoolAspect *m_autoManagedSigning = nullptr;
|
||||
Utils::StringAspect *m_signingIdentifier = nullptr;
|
||||
Utils::BoolAspect *m_autoManagedSigning = nullptr;
|
||||
};
|
||||
|
||||
class IosBuildConfigurationFactory : public QmakeProjectManager::QmakeBuildConfigurationFactory
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
@@ -77,14 +78,14 @@ static IosDeviceType toIosDeviceType(const SimulatorInfo &device)
|
||||
return iosDeviceType;
|
||||
}
|
||||
|
||||
class IosDeviceTypeAspect : public ProjectConfigurationAspect
|
||||
class IosDeviceTypeAspect : public BaseAspect
|
||||
{
|
||||
public:
|
||||
IosDeviceTypeAspect(IosRunConfiguration *runConfiguration);
|
||||
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
void toMap(QVariantMap &map) const override;
|
||||
void addToLayout(ProjectExplorer::LayoutBuilder &builder) override;
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
|
||||
IosDeviceType deviceType() const;
|
||||
void setDeviceType(const IosDeviceType &deviceType);
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include <coreplugin/editormanager/documentmodel.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
@@ -45,6 +44,7 @@
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/jsontreeitem.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QComboBox>
|
||||
@@ -728,7 +728,7 @@ BaseSettingsWidget::BaseSettingsWidget(const BaseSettings *settings, QWidget *pa
|
||||
|
||||
mainLayout->addWidget(new QLabel(tr("Name:")), row, 0);
|
||||
mainLayout->addWidget(m_name, row, 1);
|
||||
auto chooser = new Core::VariableChooser(this);
|
||||
auto chooser = new Utils::VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_name);
|
||||
|
||||
mainLayout->addWidget(new QLabel(tr("Language:")), ++row, 0);
|
||||
@@ -935,7 +935,7 @@ StdIOSettingsWidget::StdIOSettingsWidget(const StdIOSettings *settings, QWidget
|
||||
m_executable->setPath(QDir::toNativeSeparators(settings->m_executable));
|
||||
mainLayout->addWidget(m_arguments, baseRows + 1, 1);
|
||||
|
||||
auto chooser = new Core::VariableChooser(this);
|
||||
auto chooser = new Utils::VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_arguments);
|
||||
}
|
||||
|
||||
|
@@ -26,16 +26,18 @@
|
||||
#include "mcusupportrunconfiguration.h"
|
||||
#include "mcusupportconstants.h"
|
||||
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <cmakeprojectmanager/cmakekitinformation.h>
|
||||
#include <cmakeprojectmanager/cmaketool.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
|
@@ -27,14 +27,18 @@
|
||||
#include <projectexplorer/projectconfiguration.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/headerviewstretcher.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include "../mesonbuildconfiguration.h"
|
||||
#include "../mesonbuildsystem.h"
|
||||
#include "mesonbuildsettingswidget.h"
|
||||
#include "ui_mesonbuildsettingswidget.h"
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace MesonProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
MesonBuildSettingsWidget::MesonBuildSettingsWidget(MesonBuildConfiguration *buildCfg)
|
||||
: ProjectExplorer::NamedWidget{tr("Meson")}
|
||||
, ui{new Ui::MesonBuildSettingsWidget}
|
||||
@@ -43,7 +47,7 @@ MesonBuildSettingsWidget::MesonBuildSettingsWidget(MesonBuildConfiguration *buil
|
||||
ui->setupUi(this);
|
||||
ui->container->setState(Utils::DetailsWidget::NoSummary);
|
||||
ui->container->setWidget(ui->details);
|
||||
ProjectExplorer::LayoutBuilder buildDirWBuilder{ui->buildDirWidget};
|
||||
LayoutBuilder buildDirWBuilder{ui->buildDirWidget};
|
||||
auto buildDirAspect = buildCfg->buildDirectoryAspect();
|
||||
buildDirAspect->addToLayout(buildDirWBuilder);
|
||||
|
||||
|
@@ -34,11 +34,12 @@
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QLineEdit>
|
||||
|
@@ -38,7 +38,8 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projectmacroexpander.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
|
@@ -28,8 +28,9 @@
|
||||
|
||||
#include "../nimconstants.h"
|
||||
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDir>
|
||||
|
@@ -127,7 +127,6 @@ add_qtc_plugin(ProjectExplorer
|
||||
processstep.cpp processstep.h
|
||||
project.cpp project.h
|
||||
projectconfiguration.cpp projectconfiguration.h
|
||||
projectconfigurationaspects.cpp projectconfigurationaspects.h
|
||||
projectconfigurationmodel.cpp projectconfigurationmodel.h
|
||||
projectexplorer.cpp projectexplorer.h
|
||||
projectexplorer.qrc
|
||||
|
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/infolabel.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QLayout>
|
||||
|
||||
|
@@ -26,13 +26,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
#include "projectconfigurationaspects.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace Utils { class FilePath; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT BuildDirectoryAspect : public StringAspect
|
||||
class PROJECTEXPLORER_EXPORT BuildDirectoryAspect : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -43,7 +44,7 @@ public:
|
||||
bool isShadowBuild() const;
|
||||
void setProblem(const QString &description);
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
|
||||
private:
|
||||
void toMap(QVariantMap &map) const override;
|
||||
@@ -55,7 +56,7 @@ private:
|
||||
Private * const d;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT SeparateDebugInfoAspect : public TriStateAspect
|
||||
class PROJECTEXPLORER_EXPORT SeparateDebugInfoAspect : public Utils::TriStateAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@@ -46,14 +46,15 @@
|
||||
#include "toolchain.h"
|
||||
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/mimetypes/mimetype.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDebug>
|
||||
@@ -306,7 +307,7 @@ NamedWidget *BuildConfiguration::createConfigWidget()
|
||||
}
|
||||
|
||||
LayoutBuilder builder(widget);
|
||||
for (ProjectConfigurationAspect *aspect : aspects()) {
|
||||
for (BaseAspect *aspect : aspects()) {
|
||||
if (aspect->isVisible())
|
||||
aspect->addToLayout(builder.startNewRow());
|
||||
}
|
||||
|
@@ -25,7 +25,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "projectconfigurationaspects.h"
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
@@ -33,9 +35,9 @@ class PROJECTEXPLORER_EXPORT BuildPropertiesSettings
|
||||
{
|
||||
public:
|
||||
QString buildDirectoryTemplate;
|
||||
TriState separateDebugInfo;
|
||||
TriState qmlDebugging;
|
||||
TriState qtQuickCompiler;
|
||||
Utils::TriState separateDebugInfo;
|
||||
Utils::TriState qmlDebugging;
|
||||
Utils::TriState qtQuickCompiler;
|
||||
bool showQtSettings = false;
|
||||
};
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "buildpropertiessettings.h"
|
||||
#include "projectexplorer.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QFormLayout>
|
||||
@@ -36,6 +36,8 @@
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
@@ -71,7 +73,7 @@ public:
|
||||
resetButton->setEnabled(m_buildDirTemplateLineEdit.text()
|
||||
!= ProjectExplorerPlugin::defaultBuildDirectoryTemplate());
|
||||
});
|
||||
const auto chooser = new Core::VariableChooser(this);
|
||||
const auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(&m_buildDirTemplateLineEdit);
|
||||
m_buildDirTemplateLineEdit.setText(settings.buildDirectoryTemplate);
|
||||
buildDirLayout->addWidget(&m_buildDirTemplateLineEdit);
|
||||
|
@@ -35,13 +35,13 @@
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/fileinprojectfinder.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/outputformatter.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/runextensions.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QFutureWatcher>
|
||||
@@ -159,7 +159,7 @@ BuildStepConfigWidget *BuildStep::createConfigWidget()
|
||||
|
||||
{
|
||||
LayoutBuilder builder(widget);
|
||||
for (ProjectConfigurationAspect *aspect : m_aspects) {
|
||||
for (BaseAspect *aspect : qAsConst(m_aspects)) {
|
||||
if (aspect->isVisible())
|
||||
aspect->addToLayout(builder.startNewRow());
|
||||
}
|
||||
@@ -171,7 +171,7 @@ BuildStepConfigWidget *BuildStep::createConfigWidget()
|
||||
widget->setSummaryUpdater(m_summaryUpdater);
|
||||
|
||||
if (m_addMacroExpander)
|
||||
Core::VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
|
||||
return widget;
|
||||
}
|
||||
@@ -493,7 +493,7 @@ BuildStepConfigWidget::BuildStepConfigWidget(BuildStep *step)
|
||||
connect(m_step, &ProjectConfiguration::displayNameChanged,
|
||||
this, &BuildStepConfigWidget::updateSummary);
|
||||
for (auto aspect : step->aspects()) {
|
||||
connect(aspect, &ProjectConfigurationAspect::changed,
|
||||
connect(aspect, &BaseAspect::changed,
|
||||
this, &BuildStepConfigWidget::recreateSummary);
|
||||
}
|
||||
}
|
||||
|
@@ -35,11 +35,11 @@
|
||||
#include "target.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
|
@@ -93,7 +93,7 @@ public:
|
||||
CustomParserExpression warning;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT CustomParsersAspect : public ProjectConfigurationAspect
|
||||
class PROJECTEXPLORER_EXPORT CustomParsersAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "runconfiguration.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QList>
|
||||
@@ -36,7 +37,7 @@
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT EnvironmentAspect : public ProjectConfigurationAspect
|
||||
class PROJECTEXPLORER_EXPORT EnvironmentAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include "toolchainmanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/elidinglabel.h>
|
||||
@@ -45,6 +44,7 @@
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
@@ -1162,7 +1162,7 @@ private:
|
||||
{
|
||||
Utils::MacroExpander *expander = m_kit->macroExpander();
|
||||
Utils::EnvironmentDialog::Polisher polisher = [expander](QWidget *w) {
|
||||
Core::VariableChooser::addSupportForChildWidgets(w, expander);
|
||||
Utils::VariableChooser::addSupportForChildWidgets(w, expander);
|
||||
};
|
||||
auto changes = Utils::EnvironmentDialog::getEnvironmentItems(m_summaryLabel,
|
||||
currentEnvironment(),
|
||||
|
@@ -33,14 +33,14 @@
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "task.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QRegularExpression>
|
||||
@@ -59,6 +59,8 @@
|
||||
|
||||
static const char WORKING_COPY_KIT_ID[] = "modified kit";
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
@@ -116,7 +118,7 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
|
||||
connect(km, &KitManager::kitUpdated,
|
||||
this, &KitManagerConfigWidget::kitWasUpdated);
|
||||
|
||||
auto chooser = new Core::VariableChooser(this);
|
||||
auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_nameEdit);
|
||||
chooser->addMacroExpanderProvider([this]() { return m_modifiedKit->macroExpander(); });
|
||||
|
||||
|
@@ -34,15 +34,16 @@
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "target.h"
|
||||
#include "toolchain.h"
|
||||
#include "projectconfigurationaspects.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/optional.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QFormLayout>
|
||||
@@ -381,8 +382,7 @@ BuildStepConfigWidget *MakeStep::createConfigWidget()
|
||||
targetsList->hide();
|
||||
}
|
||||
|
||||
Core::VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
|
||||
VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
|
||||
widget->setSummaryUpdater([this] {
|
||||
const CommandLine make = effectiveMakeCommand(MakeStep::Display);
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "abstractprocessstep.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
namespace Utils { class Environment; }
|
||||
@@ -35,13 +36,6 @@ namespace ProjectExplorer {
|
||||
|
||||
namespace Internal { class MakeStepConfigWidget; }
|
||||
|
||||
class AspectContainer;
|
||||
class BoolAspect;
|
||||
class IntegerAspect;
|
||||
class StringAspect;
|
||||
class StringListAspect;
|
||||
class TextDisplay;
|
||||
|
||||
class PROJECTEXPLORER_EXPORT MakeStep : public ProjectExplorer::AbstractProcessStep
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -97,15 +91,15 @@ private:
|
||||
static int defaultJobCount();
|
||||
QStringList jobArguments() const;
|
||||
|
||||
StringListAspect *m_buildTargetsAspect = nullptr;
|
||||
Utils::StringListAspect *m_buildTargetsAspect = nullptr;
|
||||
QStringList m_availableTargets;
|
||||
StringAspect *m_makeCommandAspect = nullptr;
|
||||
StringAspect *m_userArgumentsAspect = nullptr;
|
||||
AspectContainer *m_jobCountContainer = nullptr;
|
||||
IntegerAspect *m_userJobCountAspect = nullptr;
|
||||
BoolAspect *m_overrideMakeflagsAspect = nullptr;
|
||||
TextDisplay *m_nonOverrideWarning = nullptr;
|
||||
BoolAspect *m_cleanAspect = nullptr;
|
||||
Utils::StringAspect *m_makeCommandAspect = nullptr;
|
||||
Utils::StringAspect *m_userArgumentsAspect = nullptr;
|
||||
Utils::AspectContainer *m_jobCountContainer = nullptr;
|
||||
Utils::IntegerAspect *m_userJobCountAspect = nullptr;
|
||||
Utils::BoolAspect *m_overrideMakeflagsAspect = nullptr;
|
||||
Utils::TextDisplay *m_nonOverrideWarning = nullptr;
|
||||
Utils::BoolAspect *m_cleanAspect = nullptr;
|
||||
bool m_disablingForSubDirsSupported = false;
|
||||
bool m_enabledForSubDirs = true;
|
||||
};
|
||||
|
@@ -29,11 +29,11 @@
|
||||
#include "buildconfiguration.h"
|
||||
#include "kit.h"
|
||||
#include "processparameters.h"
|
||||
#include "projectconfigurationaspects.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "projectexplorer_export.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/outputformatter.h>
|
||||
|
||||
|
@@ -37,179 +37,6 @@ using namespace ProjectExplorer;
|
||||
const char CONFIGURATION_ID_KEY[] = "ProjectExplorer.ProjectConfiguration.Id";
|
||||
const char DISPLAY_NAME_KEY[] = "ProjectExplorer.ProjectConfiguration.DisplayName";
|
||||
|
||||
// ProjectConfigurationAspect
|
||||
|
||||
ProjectConfigurationAspect::ProjectConfigurationAspect() = default;
|
||||
|
||||
ProjectConfigurationAspect::~ProjectConfigurationAspect() = default;
|
||||
|
||||
void ProjectConfigurationAspect::setConfigWidgetCreator
|
||||
(const ConfigWidgetCreator &configWidgetCreator)
|
||||
{
|
||||
m_configWidgetCreator = configWidgetCreator;
|
||||
}
|
||||
|
||||
QWidget *ProjectConfigurationAspect::createConfigWidget() const
|
||||
{
|
||||
return m_configWidgetCreator ? m_configWidgetCreator() : nullptr;
|
||||
}
|
||||
|
||||
void ProjectConfigurationAspect::addToLayout(LayoutBuilder &)
|
||||
{
|
||||
}
|
||||
|
||||
// LayoutBuilder
|
||||
|
||||
LayoutBuilder::LayoutBuilder(QWidget *parent, LayoutType layoutType)
|
||||
{
|
||||
if (layoutType == FormLayout) {
|
||||
m_formLayout = new QFormLayout(parent);
|
||||
m_formLayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||
} else {
|
||||
m_gridLayout = new QGridLayout(parent);
|
||||
m_gridLayout->setContentsMargins(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LayoutBuilder::LayoutBuilder(QLayout *layout)
|
||||
{
|
||||
if (auto fl = qobject_cast<QFormLayout *>(layout)) {
|
||||
m_formLayout = fl;
|
||||
} else if (auto grid = qobject_cast<QGridLayout *>(layout)) {
|
||||
m_gridLayout = grid;
|
||||
m_currentGridRow = grid->rowCount();
|
||||
m_currentGridColumn = 0;
|
||||
}
|
||||
}
|
||||
|
||||
LayoutBuilder::~LayoutBuilder()
|
||||
{
|
||||
flushPendingFormItems();
|
||||
}
|
||||
|
||||
LayoutBuilder &LayoutBuilder::startNewRow()
|
||||
{
|
||||
if (m_formLayout)
|
||||
flushPendingFormItems();
|
||||
if (m_gridLayout) {
|
||||
if (m_currentGridColumn != 0) {
|
||||
++m_currentGridRow;
|
||||
m_currentGridColumn = 0;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
LayoutBuilder &LayoutBuilder::addRow(const LayoutItem &item)
|
||||
{
|
||||
startNewRow();
|
||||
addItem(item);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void LayoutBuilder::flushPendingFormItems()
|
||||
{
|
||||
QTC_ASSERT(m_formLayout, return);
|
||||
|
||||
if (m_pendingFormItems.isEmpty())
|
||||
return;
|
||||
|
||||
// If there are more than two items, we cram the last ones in one hbox.
|
||||
if (m_pendingFormItems.size() > 2) {
|
||||
auto hbox = new QHBoxLayout;
|
||||
hbox->setContentsMargins(0, 0, 0, 0);
|
||||
for (int i = 1; i < m_pendingFormItems.size(); ++i) {
|
||||
if (QWidget *w = m_pendingFormItems.at(i).widget)
|
||||
hbox->addWidget(w);
|
||||
else if (QLayout *l = m_pendingFormItems.at(i).layout)
|
||||
hbox->addItem(l);
|
||||
else
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
while (m_pendingFormItems.size() >= 2)
|
||||
m_pendingFormItems.takeLast();
|
||||
m_pendingFormItems.append(LayoutItem(hbox));
|
||||
}
|
||||
|
||||
if (m_pendingFormItems.size() == 1) { // One one item given, so this spans both columns.
|
||||
if (auto layout = m_pendingFormItems.at(0).layout)
|
||||
m_formLayout->addRow(layout);
|
||||
else if (auto widget = m_pendingFormItems.at(0).widget)
|
||||
m_formLayout->addRow(widget);
|
||||
} else if (m_pendingFormItems.size() == 2) { // Normal case, both columns used.
|
||||
if (auto label = m_pendingFormItems.at(0).widget) {
|
||||
if (auto layout = m_pendingFormItems.at(1).layout)
|
||||
m_formLayout->addRow(label, layout);
|
||||
else if (auto widget = m_pendingFormItems.at(1).widget)
|
||||
m_formLayout->addRow(label, widget);
|
||||
} else {
|
||||
if (auto layout = m_pendingFormItems.at(1).layout)
|
||||
m_formLayout->addRow(m_pendingFormItems.at(0).text, layout);
|
||||
else if (auto widget = m_pendingFormItems.at(1).widget)
|
||||
m_formLayout->addRow(m_pendingFormItems.at(0).text, widget);
|
||||
}
|
||||
} else {
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
m_pendingFormItems.clear();
|
||||
}
|
||||
|
||||
QLayout *LayoutBuilder::layout() const
|
||||
{
|
||||
if (m_formLayout)
|
||||
return m_formLayout;
|
||||
return m_gridLayout;
|
||||
}
|
||||
|
||||
LayoutBuilder &LayoutBuilder::addItem(LayoutItem item)
|
||||
{
|
||||
if (item.widget && !item.widget->parent())
|
||||
item.widget->setParent(layout()->parentWidget());
|
||||
|
||||
if (item.aspect) {
|
||||
item.aspect->addToLayout(*this);
|
||||
} else {
|
||||
if (m_gridLayout) {
|
||||
if (auto widget = item.widget)
|
||||
m_gridLayout->addWidget(widget, m_currentGridRow, m_currentGridColumn, 1, item.span, item.align);
|
||||
m_currentGridColumn += item.span;
|
||||
} else {
|
||||
m_pendingFormItems.append(item);
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// ProjectConfigurationAspects
|
||||
|
||||
ProjectConfigurationAspects::ProjectConfigurationAspects() = default;
|
||||
|
||||
ProjectConfigurationAspects::~ProjectConfigurationAspects()
|
||||
{
|
||||
qDeleteAll(base());
|
||||
}
|
||||
|
||||
ProjectConfigurationAspect *ProjectConfigurationAspects::aspect(Utils::Id id) const
|
||||
{
|
||||
return Utils::findOrDefault(base(), Utils::equal(&ProjectConfigurationAspect::id, id));
|
||||
}
|
||||
|
||||
void ProjectConfigurationAspects::fromMap(const QVariantMap &map) const
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : *this)
|
||||
aspect->fromMap(map);
|
||||
}
|
||||
|
||||
void ProjectConfigurationAspects::toMap(QVariantMap &map) const
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : *this)
|
||||
aspect->toMap(map);
|
||||
}
|
||||
|
||||
|
||||
// ProjectConfiguration
|
||||
|
||||
ProjectConfiguration::ProjectConfiguration(QObject *parent, Utils::Id id)
|
||||
@@ -302,14 +129,14 @@ bool ProjectConfiguration::fromMap(const QVariantMap &map)
|
||||
return true;
|
||||
}
|
||||
|
||||
ProjectConfigurationAspect *ProjectConfiguration::aspect(Utils::Id id) const
|
||||
Utils::BaseAspect *ProjectConfiguration::aspect(Utils::Id id) const
|
||||
{
|
||||
return m_aspects.aspect(id);
|
||||
}
|
||||
|
||||
void ProjectConfiguration::acquaintAspects()
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : m_aspects)
|
||||
for (Utils::BaseAspect *aspect : m_aspects)
|
||||
aspect->acquaintSiblings(m_aspects);
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/displayname.h>
|
||||
#include <utils/id.h>
|
||||
|
||||
@@ -36,150 +37,12 @@
|
||||
#include <QVariantMap>
|
||||
#include <QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFormLayout;
|
||||
class QGridLayout;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class Kit;
|
||||
class Project;
|
||||
class ProjectConfigurationAspect;
|
||||
class ProjectConfigurationAspects;
|
||||
class Target;
|
||||
|
||||
class PROJECTEXPLORER_EXPORT LayoutBuilder
|
||||
{
|
||||
public:
|
||||
enum LayoutType { GridLayout, FormLayout };
|
||||
explicit LayoutBuilder(QWidget *parent, LayoutType layoutType = FormLayout);
|
||||
explicit LayoutBuilder(QLayout *layout); // Adds to existing layout.
|
||||
|
||||
~LayoutBuilder();
|
||||
|
||||
class LayoutItem
|
||||
{
|
||||
public:
|
||||
LayoutItem(QLayout *layout, int span = 1) : layout(layout), span(span) {}
|
||||
LayoutItem(QWidget *widget, int span = 1, Qt::Alignment align = {})
|
||||
: widget(widget), span(span), align(align) {}
|
||||
LayoutItem(ProjectConfigurationAspect *aspect) : aspect(aspect) {}
|
||||
LayoutItem(const QString &text) : text(text) {}
|
||||
|
||||
QLayout *layout = nullptr;
|
||||
QWidget *widget = nullptr;
|
||||
ProjectConfigurationAspect *aspect = nullptr;
|
||||
QString text;
|
||||
int span = 1;
|
||||
Qt::Alignment align;
|
||||
};
|
||||
|
||||
template<typename ...Items>
|
||||
LayoutBuilder &addItems(LayoutItem first, Items... rest) {
|
||||
return addItem(first).addItems(rest...);
|
||||
}
|
||||
LayoutBuilder &addItems() { return *this; }
|
||||
LayoutBuilder &addItem(LayoutItem item);
|
||||
|
||||
LayoutBuilder &startNewRow();
|
||||
LayoutBuilder &addRow(const LayoutItem &item);
|
||||
|
||||
QLayout *layout() const;
|
||||
|
||||
private:
|
||||
void flushPendingFormItems();
|
||||
|
||||
QFormLayout *m_formLayout = nullptr;
|
||||
QGridLayout *m_gridLayout = nullptr;
|
||||
QList<LayoutItem> m_pendingFormItems;
|
||||
int m_currentGridRow = 0;
|
||||
int m_currentGridColumn = 0;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProjectConfigurationAspect : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProjectConfigurationAspect();
|
||||
~ProjectConfigurationAspect() override;
|
||||
|
||||
void setId(Utils::Id id) { m_id = id; }
|
||||
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
||||
void setSettingsKey(const QString &settingsKey) { m_settingsKey = settingsKey; }
|
||||
|
||||
Utils::Id id() const { return m_id; }
|
||||
QString displayName() const { return m_displayName; }
|
||||
QString settingsKey() const { return m_settingsKey; }
|
||||
|
||||
bool isVisible() const { return m_visible; }
|
||||
void setVisible(bool visible) { m_visible = visible; }
|
||||
|
||||
using ConfigWidgetCreator = std::function<QWidget *()>;
|
||||
void setConfigWidgetCreator(const ConfigWidgetCreator &configWidgetCreator);
|
||||
QWidget *createConfigWidget() const;
|
||||
|
||||
virtual void fromMap(const QVariantMap &) {}
|
||||
virtual void toMap(QVariantMap &) const {}
|
||||
virtual void acquaintSiblings(const ProjectConfigurationAspects &) {}
|
||||
|
||||
virtual void addToLayout(LayoutBuilder &builder);
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
protected:
|
||||
virtual void setVisibleDynamic(bool visible) { Q_UNUSED(visible) } // TODO: Better name? Merge with setVisible() somehow?
|
||||
|
||||
Utils::Id m_id;
|
||||
QString m_displayName;
|
||||
QString m_settingsKey; // Name of data in settings.
|
||||
bool m_visible = true;
|
||||
ConfigWidgetCreator m_configWidgetCreator;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProjectConfigurationAspects
|
||||
: private QList<ProjectConfigurationAspect *>
|
||||
{
|
||||
using Base = QList<ProjectConfigurationAspect *>;
|
||||
|
||||
public:
|
||||
ProjectConfigurationAspects();
|
||||
ProjectConfigurationAspects(const ProjectConfigurationAspects &) = delete;
|
||||
ProjectConfigurationAspects &operator=(const ProjectConfigurationAspects &) = delete;
|
||||
~ProjectConfigurationAspects();
|
||||
|
||||
template <class Aspect, typename ...Args>
|
||||
Aspect *addAspect(Args && ...args)
|
||||
{
|
||||
auto aspect = new Aspect(args...);
|
||||
append(aspect);
|
||||
return aspect;
|
||||
}
|
||||
|
||||
ProjectConfigurationAspect *aspect(Utils::Id id) const;
|
||||
|
||||
template <typename T> T *aspect() const
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : *this)
|
||||
if (T *result = qobject_cast<T *>(aspect))
|
||||
return result;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void fromMap(const QVariantMap &map) const;
|
||||
void toMap(QVariantMap &map) const;
|
||||
|
||||
using Base::append;
|
||||
using Base::begin;
|
||||
using Base::end;
|
||||
|
||||
private:
|
||||
Base &base() { return *this; }
|
||||
const Base &base() const { return *this; }
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ProjectConfiguration : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -218,9 +81,9 @@ public:
|
||||
return m_aspects.addAspect<Aspect>(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
const ProjectConfigurationAspects &aspects() const { return m_aspects; }
|
||||
const Utils::BaseAspects &aspects() const { return m_aspects; }
|
||||
|
||||
ProjectConfigurationAspect *aspect(Utils::Id id) const;
|
||||
Utils::BaseAspect *aspect(Utils::Id id) const;
|
||||
template <typename T> T *aspect() const { return m_aspects.aspect<T>(); }
|
||||
|
||||
void acquaintAspects();
|
||||
@@ -230,7 +93,7 @@ signals:
|
||||
void toolTipChanged();
|
||||
|
||||
protected:
|
||||
ProjectConfigurationAspects m_aspects;
|
||||
Utils::BaseAspects m_aspects;
|
||||
|
||||
private:
|
||||
QPointer<Target> m_target;
|
||||
|
@@ -163,7 +163,6 @@ HEADERS += projectexplorer.h \
|
||||
projectmacro.h \
|
||||
makestep.h \
|
||||
parseissuesdialog.h \
|
||||
projectconfigurationaspects.h \
|
||||
treescanner.h \
|
||||
rawprojectpart.h \
|
||||
simpleprojectwizard.h
|
||||
@@ -310,7 +309,6 @@ SOURCES += projectexplorer.cpp \
|
||||
projectmacro.cpp \
|
||||
makestep.cpp \
|
||||
parseissuesdialog.cpp \
|
||||
projectconfigurationaspects.cpp \
|
||||
treescanner.cpp \
|
||||
rawprojectpart.cpp \
|
||||
simpleprojectwizard.cpp
|
||||
|
@@ -107,7 +107,6 @@ Project {
|
||||
"processstep.cpp", "processstep.h",
|
||||
"project.cpp", "project.h",
|
||||
"projectconfiguration.cpp", "projectconfiguration.h",
|
||||
"projectconfigurationaspects.cpp", "projectconfigurationaspects.h",
|
||||
"projectconfigurationmodel.cpp", "projectconfigurationmodel.h",
|
||||
"projectexplorer.cpp", "projectexplorer.h",
|
||||
"projectexplorer.qrc",
|
||||
|
@@ -43,13 +43,14 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/checkablemessagebox.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/outputformatter.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFormLayout>
|
||||
@@ -223,13 +224,13 @@ QWidget *RunConfiguration::createConfigurationWidget()
|
||||
auto widget = new QWidget;
|
||||
{
|
||||
LayoutBuilder builder(widget);
|
||||
for (ProjectConfigurationAspect *aspect : m_aspects) {
|
||||
for (BaseAspect *aspect : qAsConst(m_aspects)) {
|
||||
if (aspect->isVisible())
|
||||
aspect->addToLayout(builder.startNewRow());
|
||||
}
|
||||
}
|
||||
|
||||
Core::VariableChooser::addSupportForChildWidgets(widget, &m_expander);
|
||||
VariableChooser::addSupportForChildWidgets(widget, &m_expander);
|
||||
|
||||
auto detailsWidget = new Utils::DetailsWidget;
|
||||
detailsWidget->setState(DetailsWidget::NoSummary);
|
||||
@@ -245,7 +246,7 @@ void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory)
|
||||
QMap<Utils::Id, QVariantMap> RunConfiguration::aspectData() const
|
||||
{
|
||||
QMap<Utils::Id, QVariantMap> data;
|
||||
for (ProjectConfigurationAspect *aspect : m_aspects)
|
||||
for (BaseAspect *aspect : qAsConst(m_aspects))
|
||||
aspect->toMap(data[aspect->id()]);
|
||||
return data;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "task.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/port.h>
|
||||
@@ -90,7 +91,7 @@ protected:
|
||||
*
|
||||
*/
|
||||
|
||||
class PROJECTEXPLORER_EXPORT GlobalOrProjectAspect : public ProjectConfigurationAspect
|
||||
class PROJECTEXPLORER_EXPORT GlobalOrProjectAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -157,7 +158,7 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
using AspectFactory = std::function<ProjectConfigurationAspect *(Target *)>;
|
||||
using AspectFactory = std::function<Utils::BaseAspect *(Target *)>;
|
||||
template <class T> static void registerAspect()
|
||||
{
|
||||
addAspectFactory([](Target *target) { return new T(target); });
|
||||
|
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <utils/detailsbutton.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/utilsicons.h>
|
||||
@@ -171,7 +172,7 @@ void WorkingDirectoryAspect::addToLayout(LayoutBuilder &builder)
|
||||
builder.addItems(tr("Working directory:"), m_chooser.data(), m_resetButton.data());
|
||||
}
|
||||
|
||||
void WorkingDirectoryAspect::acquaintSiblings(const ProjectConfigurationAspects &siblings)
|
||||
void WorkingDirectoryAspect::acquaintSiblings(const BaseAspects &siblings)
|
||||
{
|
||||
m_envAspect = siblings.aspect<EnvironmentAspect>();
|
||||
}
|
||||
@@ -498,7 +499,7 @@ void ExecutableAspect::setExecutable(const FilePath &executable)
|
||||
|
||||
void ExecutableAspect::setSettingsKey(const QString &key)
|
||||
{
|
||||
ProjectConfigurationAspect::setSettingsKey(key);
|
||||
BaseAspect::setSettingsKey(key);
|
||||
m_executable.setSettingsKey(key);
|
||||
}
|
||||
|
||||
|
@@ -25,10 +25,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "projectconfigurationaspects.h"
|
||||
#include "applicationlauncher.h"
|
||||
#include "environmentaspect.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -41,14 +42,14 @@ namespace Utils { class ExpandButton; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT TerminalAspect : public ProjectConfigurationAspect
|
||||
class PROJECTEXPLORER_EXPORT TerminalAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TerminalAspect();
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
|
||||
bool useTerminal() const;
|
||||
void setUseTerminalHint(bool useTerminal);
|
||||
@@ -67,15 +68,15 @@ private:
|
||||
QPointer<QCheckBox> m_checkBox; // Owned by RunConfigWidget
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT WorkingDirectoryAspect : public ProjectConfigurationAspect
|
||||
class PROJECTEXPLORER_EXPORT WorkingDirectoryAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WorkingDirectoryAspect();
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void acquaintSiblings(const ProjectConfigurationAspects &) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void acquaintSiblings(const Utils::BaseAspects &) override;
|
||||
|
||||
Utils::FilePath workingDirectory(const Utils::MacroExpander *expander) const;
|
||||
Utils::FilePath defaultWorkingDirectory() const;
|
||||
@@ -97,14 +98,14 @@ private:
|
||||
QPointer<QToolButton> m_resetButton;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ArgumentsAspect : public ProjectConfigurationAspect
|
||||
class PROJECTEXPLORER_EXPORT ArgumentsAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ArgumentsAspect();
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
|
||||
QString arguments(const Utils::MacroExpander *expander) const;
|
||||
QString unexpandedArguments() const;
|
||||
@@ -129,7 +130,7 @@ private:
|
||||
std::function<QString()> m_resetter;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT UseLibraryPathsAspect : public BoolAspect
|
||||
class PROJECTEXPLORER_EXPORT UseLibraryPathsAspect : public Utils::BoolAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -137,7 +138,7 @@ public:
|
||||
UseLibraryPathsAspect();
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT UseDyldSuffixAspect : public BoolAspect
|
||||
class PROJECTEXPLORER_EXPORT UseDyldSuffixAspect : public Utils::BoolAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -145,7 +146,7 @@ public:
|
||||
UseDyldSuffixAspect();
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ExecutableAspect : public ProjectConfigurationAspect
|
||||
class PROJECTEXPLORER_EXPORT ExecutableAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -158,14 +159,14 @@ public:
|
||||
|
||||
void setSettingsKey(const QString &key);
|
||||
void makeOverridable(const QString &overridingKey, const QString &useOverridableKey);
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void setLabelText(const QString &labelText);
|
||||
void setPlaceHolderText(const QString &placeHolderText);
|
||||
void setExecutablePathStyle(Utils::OsType osType);
|
||||
void setHistoryCompleter(const QString &historyCompleterKey);
|
||||
void setExpectedKind(const Utils::PathChooser::Kind expectedKind);
|
||||
void setEnvironment(const Utils::Environment &env);
|
||||
void setDisplayStyle(StringAspect::DisplayStyle style);
|
||||
void setDisplayStyle(Utils::StringAspect::DisplayStyle style);
|
||||
|
||||
protected:
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
@@ -174,11 +175,11 @@ protected:
|
||||
private:
|
||||
QString executableText() const;
|
||||
|
||||
StringAspect m_executable;
|
||||
StringAspect *m_alternativeExecutable = nullptr;
|
||||
Utils::StringAspect m_executable;
|
||||
Utils::StringAspect *m_alternativeExecutable = nullptr;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT SymbolFileAspect : public StringAspect
|
||||
class PROJECTEXPLORER_EXPORT SymbolFileAspect : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -45,10 +45,10 @@
|
||||
#include <utils/outputformatter.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFormLayout>
|
||||
@@ -909,7 +909,7 @@ const MacroExpander *RunControl::macroExpander() const
|
||||
return d->macroExpander;
|
||||
}
|
||||
|
||||
ProjectConfigurationAspect *RunControl::aspect(Utils::Id id) const
|
||||
BaseAspect *RunControl::aspect(Utils::Id id) const
|
||||
{
|
||||
return d->runConfiguration ? d->runConfiguration->aspect(id) : nullptr;
|
||||
}
|
||||
|
@@ -224,7 +224,7 @@ public:
|
||||
Project *project() const;
|
||||
Kit *kit() const;
|
||||
const Utils::MacroExpander *macroExpander() const;
|
||||
ProjectConfigurationAspect *aspect(Utils::Id id) const;
|
||||
Utils::BaseAspect *aspect(Utils::Id id) const;
|
||||
template <typename T> T *aspect() const {
|
||||
return runConfiguration() ? runConfiguration()->aspect<T>() : nullptr;
|
||||
}
|
||||
|
@@ -474,7 +474,7 @@ QString RunSettingsWidget::uniqueRCName(const QString &name)
|
||||
|
||||
void RunSettingsWidget::addRunControlWidgets()
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : m_runConfiguration->aspects()) {
|
||||
for (Utils::BaseAspect *aspect : m_runConfiguration->aspects()) {
|
||||
if (QWidget *rcw = aspect->createConfigWidget()) {
|
||||
auto label = new QLabel(this);
|
||||
label->setText(aspect->displayName());
|
||||
|
@@ -37,14 +37,15 @@
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/localenvironmentaspect.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/outputformatter.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
@@ -133,7 +134,7 @@ private:
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
class InterpreterAspect : public ProjectConfigurationAspect
|
||||
class InterpreterAspect : public BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -85,9 +85,9 @@ public:
|
||||
QString configurationName() const;
|
||||
QString equivalentCommandLine(const QbsBuildStepData &stepData) const;
|
||||
|
||||
ProjectExplorer::TriState qmlDebuggingSetting() const;
|
||||
ProjectExplorer::TriState qtQuickCompilerSetting() const;
|
||||
ProjectExplorer::TriState separateDebugInfoSetting() const;
|
||||
Utils::TriState qmlDebuggingSetting() const;
|
||||
Utils::TriState qtQuickCompilerSetting() const;
|
||||
Utils::TriState separateDebugInfoSetting() const;
|
||||
|
||||
signals:
|
||||
void qbsConfigurationChanged();
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
QStringList m_changedFiles;
|
||||
QStringList m_activeFileTags;
|
||||
QStringList m_products;
|
||||
ProjectExplorer::StringAspect *m_configurationName = nullptr;
|
||||
Utils::StringAspect *m_configurationName = nullptr;
|
||||
QbsBuildSystem *m_buildSystem = nullptr;
|
||||
};
|
||||
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include "qbssettings.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -43,6 +42,7 @@
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QCheckBox>
|
||||
@@ -637,7 +637,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
|
||||
cleanInstallRootCheckBox->setText(tr("Clean install root"));
|
||||
defaultInstallDirCheckBox->setText(tr("Use default location"));
|
||||
|
||||
auto chooser = new Core::VariableChooser(this);
|
||||
auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(propertyEdit);
|
||||
chooser->addSupportedWidget(installDirChooser->lineEdit());
|
||||
chooser->addMacroExpanderProvider([step] { return step->macroExpander(); });
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
|
@@ -28,11 +28,13 @@
|
||||
#include "qbsbuildconfiguration.h"
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/task.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class ErrorInfo;
|
||||
class QbsSession;
|
||||
|
||||
@@ -60,8 +62,8 @@ private:
|
||||
void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
|
||||
const QString &message, const QString &file, int line);
|
||||
|
||||
ProjectExplorer::BoolAspect *m_dryRunAspect = nullptr;
|
||||
ProjectExplorer::BoolAspect *m_keepGoingAspect = nullptr;
|
||||
Utils::BoolAspect *m_dryRunAspect = nullptr;
|
||||
Utils::BoolAspect *m_keepGoingAspect = nullptr;
|
||||
|
||||
QStringList m_products;
|
||||
QbsSession *m_session = nullptr;
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QJsonObject>
|
||||
@@ -45,6 +46,7 @@
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
|
@@ -29,11 +29,13 @@
|
||||
#include "qbssession.h"
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/task.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class ErrorInfo;
|
||||
class QbsSession;
|
||||
|
||||
@@ -62,9 +64,9 @@ private:
|
||||
void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
|
||||
const QString &message, const Utils::FilePath &file, int line);
|
||||
|
||||
ProjectExplorer::BoolAspect *m_cleanInstallRoot = nullptr;
|
||||
ProjectExplorer::BoolAspect *m_dryRun = nullptr;
|
||||
ProjectExplorer::BoolAspect *m_keepGoing = nullptr;
|
||||
Utils::BoolAspect *m_cleanInstallRoot = nullptr;
|
||||
Utils::BoolAspect *m_dryRun = nullptr;
|
||||
Utils::BoolAspect *m_keepGoing = nullptr;
|
||||
|
||||
QbsSession *m_session = nullptr;
|
||||
QString m_description;
|
||||
|
@@ -36,15 +36,15 @@
|
||||
#include <QTextStream>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
using namespace QmakeProjectManager;
|
||||
using namespace Internal;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;;
|
||||
|
||||
using Utils::FilePath;
|
||||
using Utils::QtcProcess;
|
||||
using QtSupport::QtVersionManager;
|
||||
using QtSupport::BaseQtVersion;
|
||||
|
||||
namespace QmakeProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
static QString findQMakeLine(const QString &makefile, const QString &key)
|
||||
{
|
||||
QFile fi(makefile);
|
||||
@@ -396,6 +396,8 @@ void MakeFileParse::parseCommandLine(const QString &command, const QString &proj
|
||||
}
|
||||
}
|
||||
|
||||
} // Internal
|
||||
} // QmakeProjectManager
|
||||
|
||||
// Unit tests:
|
||||
|
||||
|
@@ -27,10 +27,11 @@
|
||||
|
||||
#include "qmakeprojectmanager_global.h"
|
||||
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace ProjectExplorer { class FileNode; }
|
||||
|
||||
namespace QmakeProjectManager {
|
||||
@@ -96,13 +97,13 @@ public:
|
||||
static bool isBuildDirAtSafeLocation(const QString &sourceDir, const QString &buildDir);
|
||||
bool isBuildDirAtSafeLocation() const;
|
||||
|
||||
ProjectExplorer::TriState separateDebugInfo() const;
|
||||
Utils::TriState separateDebugInfo() const;
|
||||
void forceSeparateDebugInfo(bool sepDebugInfo);
|
||||
|
||||
ProjectExplorer::TriState qmlDebugging() const;
|
||||
Utils::TriState qmlDebugging() const;
|
||||
void forceQmlDebugging(bool enable);
|
||||
|
||||
ProjectExplorer::TriState useQtQuickCompiler() const;
|
||||
Utils::TriState useQtQuickCompiler() const;
|
||||
void forceQtQuickCompiler(bool enable);
|
||||
|
||||
signals:
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include "qmakesettings.h"
|
||||
#include "qmakestep.h"
|
||||
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
@@ -43,7 +42,9 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/xcodebuildparser.h>
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
@@ -46,14 +46,15 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDir>
|
||||
@@ -580,7 +581,8 @@ BuildStepConfigWidget *QMakeStep::createConfigWidget()
|
||||
if (QmakeBuildConfiguration *bc = qmakeBuildConfiguration())
|
||||
BuildManager::buildLists({bc->cleanSteps()});
|
||||
});
|
||||
auto chooser = new Core::VariableChooser(qmakeAdditonalArgumentsLineEdit);
|
||||
|
||||
auto chooser = new VariableChooser(qmakeAdditonalArgumentsLineEdit);
|
||||
chooser->addMacroExpanderProvider([this] { return macroExpander(); });
|
||||
chooser->addSupportedWidget(qmakeAdditonalArgumentsLineEdit);
|
||||
|
||||
|
@@ -28,8 +28,8 @@
|
||||
#include "qmakeprojectmanager_global.h"
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <memory>
|
||||
@@ -83,9 +83,9 @@ public:
|
||||
QString targetTriple;
|
||||
TargetArchConfig archConfig = NoArch;
|
||||
OsType osType = NoOsType;
|
||||
ProjectExplorer::TriState separateDebugInfo;
|
||||
ProjectExplorer::TriState linkQmlDebuggingQQ2;
|
||||
ProjectExplorer::TriState useQtQuickCompiler;
|
||||
Utils::TriState separateDebugInfo;
|
||||
Utils::TriState linkQmlDebuggingQQ2;
|
||||
Utils::TriState useQtQuickCompiler;
|
||||
};
|
||||
|
||||
|
||||
@@ -103,9 +103,9 @@ inline bool operator !=(const QMakeStepConfig &a, const QMakeStepConfig &b) {
|
||||
inline QDebug operator<<(QDebug dbg, const QMakeStepConfig &c)
|
||||
{
|
||||
dbg << c.archConfig << c.osType
|
||||
<< (c.linkQmlDebuggingQQ2 == ProjectExplorer::TriState::Enabled)
|
||||
<< (c.useQtQuickCompiler == ProjectExplorer::TriState::Enabled)
|
||||
<< (c.separateDebugInfo == ProjectExplorer::TriState::Enabled);
|
||||
<< (c.linkQmlDebuggingQQ2 == Utils::TriState::Enabled)
|
||||
<< (c.useQtQuickCompiler == Utils::TriState::Enabled)
|
||||
<< (c.separateDebugInfo == Utils::TriState::Enabled);
|
||||
return dbg;
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,8 @@
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
@@ -69,7 +71,7 @@ QmlMainFileAspect::~QmlMainFileAspect()
|
||||
delete m_fileListCombo;
|
||||
}
|
||||
|
||||
void QmlMainFileAspect::addToLayout(LayoutBuilder &builder)
|
||||
void QmlMainFileAspect::addToLayout(Utils::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_ASSERT(!m_fileListCombo, delete m_fileListCombo);
|
||||
m_fileListCombo = new QComboBox;
|
||||
|
@@ -44,7 +44,7 @@ namespace QmlProjectManager {
|
||||
class QmlProject;
|
||||
class QmlBuildSystem;
|
||||
|
||||
class QMLPROJECTMANAGER_EXPORT QmlMainFileAspect : public ProjectExplorer::ProjectConfigurationAspect
|
||||
class QMLPROJECTMANAGER_EXPORT QmlMainFileAspect : public Utils::BaseAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
FileInSettings
|
||||
};
|
||||
|
||||
void addToLayout(ProjectExplorer::LayoutBuilder &builder) final;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
|
||||
namespace QmlProjectManager {
|
||||
|
||||
class QMLPROJECTMANAGER_EXPORT QmlMultiLanguageAspect : public ProjectExplorer::BoolAspect
|
||||
class QMLPROJECTMANAGER_EXPORT QmlMultiLanguageAspect : public Utils::BoolAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@@ -40,11 +40,11 @@
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/environmentaspect.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
|
@@ -31,7 +31,7 @@
|
||||
namespace Qnx {
|
||||
namespace Internal {
|
||||
|
||||
class QtLibPathAspect : public ProjectExplorer::StringAspect
|
||||
class QtLibPathAspect : public Utils::StringAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -30,12 +30,15 @@
|
||||
#include <projectexplorer/buildpropertiessettings.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
|
||||
#include <utils/infolabel.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QLayout>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace QtSupport {
|
||||
|
||||
@@ -109,7 +112,7 @@ void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder)
|
||||
changeHandler();
|
||||
}
|
||||
|
||||
void QtQuickCompilerAspect::acquaintSiblings(const ProjectConfigurationAspects &siblings)
|
||||
void QtQuickCompilerAspect::acquaintSiblings(const BaseAspects &siblings)
|
||||
{
|
||||
m_qmlDebuggingAspect = siblings.aspect<QmlDebuggingAspect>();
|
||||
}
|
||||
|
@@ -27,24 +27,26 @@
|
||||
|
||||
#include "qtsupport_global.h"
|
||||
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
|
||||
namespace QtSupport {
|
||||
|
||||
class QTSUPPORT_EXPORT QmlDebuggingAspect : public ProjectExplorer::TriStateAspect
|
||||
class QTSUPPORT_EXPORT QmlDebuggingAspect : public Utils::TriStateAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QmlDebuggingAspect();
|
||||
|
||||
void setKit(const ProjectExplorer::Kit *kit) { m_kit = kit; }
|
||||
void addToLayout(ProjectExplorer::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
|
||||
private:
|
||||
const ProjectExplorer::Kit *m_kit = nullptr;
|
||||
};
|
||||
|
||||
class QTSUPPORT_EXPORT QtQuickCompilerAspect : public ProjectExplorer::TriStateAspect
|
||||
class QTSUPPORT_EXPORT QtQuickCompilerAspect : public Utils::TriStateAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -53,8 +55,8 @@ public:
|
||||
void setKit(const ProjectExplorer::Kit *kit) { m_kit = kit; }
|
||||
|
||||
private:
|
||||
void addToLayout(ProjectExplorer::LayoutBuilder &builder) override;
|
||||
void acquaintSiblings(const ProjectExplorer::ProjectConfigurationAspects &siblings) override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void acquaintSiblings(const Utils::BaseAspects &siblings) override;
|
||||
|
||||
const ProjectExplorer::Kit *m_kit = nullptr;
|
||||
const QmlDebuggingAspect *m_qmlDebuggingAspect = nullptr;
|
||||
|
@@ -39,7 +39,6 @@
|
||||
#include <coreplugin/dialogs/restartdialog.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projectexplorericons.h>
|
||||
@@ -55,6 +54,7 @@
|
||||
#include <utils/runextensions.h>
|
||||
#include <utils/treemodel.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QDir>
|
||||
@@ -326,7 +326,7 @@ QtOptionsPageWidget::QtOptionsPageWidget()
|
||||
connect(ProjectExplorer::ToolChainManager::instance(), &ToolChainManager::toolChainsChanged,
|
||||
this, &QtOptionsPageWidget::toolChainsUpdated);
|
||||
|
||||
auto chooser = new Core::VariableChooser(this);
|
||||
auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_versionUi.nameEdit, "Qt:Name");
|
||||
chooser->addMacroExpanderProvider([this] {
|
||||
BaseQtVersion *version = currentVersion();
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace RemoteLinux {
|
||||
|
||||
|
@@ -30,8 +30,10 @@
|
||||
#include <projectexplorer/deploymentdata.h>
|
||||
#include <projectexplorer/makestep.h>
|
||||
|
||||
namespace ProjectExplorer { class StringAspect; }
|
||||
namespace Utils { class FilePath; }
|
||||
namespace Utils {
|
||||
class FilePath;
|
||||
class StringAspect;
|
||||
} // Utils
|
||||
|
||||
namespace RemoteLinux {
|
||||
|
||||
@@ -60,7 +62,7 @@ private:
|
||||
void updateFullCommandLine();
|
||||
void updateFromCustomCommandLineAspect();
|
||||
|
||||
ProjectExplorer::StringAspect *customCommandLineAspect() const;
|
||||
Utils::StringAspect *customCommandLineAspect() const;
|
||||
|
||||
ProjectExplorer::DeploymentData m_deploymentData;
|
||||
bool m_noInstallTarget = false;
|
||||
|
@@ -27,11 +27,12 @@
|
||||
|
||||
#include "remotelinuxcheckforfreediskspaceservice.h"
|
||||
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <limits>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace RemoteLinux {
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user