forked from qt-creator/qt-creator
Utils: Flatten LayoutBuilder related hierarchies
Originally the idea was to only expose LayoutBuilder, but we are getting more and more related items. Be consequent now, and have everything in Utils::Layouting, but not in nested classes. Change-Id: Ic0f98595882e5c60a25c30ec52df4a0ea79bc0ca Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
#include <QSpinBox>
|
||||
#include <QTextEdit>
|
||||
|
||||
using namespace Utils::Layouting;
|
||||
|
||||
namespace Utils {
|
||||
namespace Internal {
|
||||
|
||||
@@ -206,17 +208,17 @@ void BaseAspect::setupLabel()
|
||||
registerSubWidget(d->m_label);
|
||||
}
|
||||
|
||||
void BaseAspect::addLabeledItem(LayoutBuilder &builder, QWidget *widget)
|
||||
void BaseAspect::addLabeledItem(Layouting::LayoutBuilder &builder, QWidget *widget)
|
||||
{
|
||||
setupLabel();
|
||||
if (QLabel *l = label()) {
|
||||
l->setBuddy(widget);
|
||||
builder.addItem(l);
|
||||
LayoutBuilder::LayoutItem item(widget);
|
||||
LayoutItem item(widget);
|
||||
item.span = std::max(d->m_spanX - 1, 1);
|
||||
builder.addItem(item);
|
||||
} else {
|
||||
builder.addItem(LayoutBuilder::LayoutItem(widget));
|
||||
builder.addItem(LayoutItem(widget));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,7 +419,7 @@ QAction *BaseAspect::action()
|
||||
Adds the visual representation of this aspect to a layout using
|
||||
a layout builder.
|
||||
*/
|
||||
void BaseAspect::addToLayout(LayoutBuilder &)
|
||||
void BaseAspect::addToLayout(Layouting::LayoutBuilder &)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1042,7 +1044,7 @@ void StringAspect::setUncheckedSemantics(StringAspect::UncheckedSemantics semant
|
||||
d->m_uncheckedSemantics = semantics;
|
||||
}
|
||||
|
||||
void StringAspect::addToLayout(LayoutBuilder &builder)
|
||||
void StringAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
if (d->m_checker && d->m_checkBoxPlacement == CheckBoxPlacement::Top) {
|
||||
d->m_checker->addToLayout(builder);
|
||||
@@ -1312,7 +1314,7 @@ BoolAspect::~BoolAspect() = default;
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void BoolAspect::addToLayout(LayoutBuilder &builder)
|
||||
void BoolAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!d->m_checkBox);
|
||||
d->m_checkBox = createSubWidget<QCheckBox>();
|
||||
@@ -1323,7 +1325,7 @@ void BoolAspect::addToLayout(LayoutBuilder &builder)
|
||||
break;
|
||||
case LabelPlacement::AtCheckBox: {
|
||||
d->m_checkBox->setText(labelText());
|
||||
LayoutBuilder::LayoutType type = builder.layoutType();
|
||||
Layouting::LayoutBuilder::LayoutType type = builder.layoutType();
|
||||
if (type == LayoutBuilder::FormLayout)
|
||||
builder.addItem(createSubWidget<QLabel>());
|
||||
builder.addItem(d->m_checkBox.data());
|
||||
@@ -1465,7 +1467,7 @@ SelectionAspect::~SelectionAspect() = default;
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void SelectionAspect::addToLayout(LayoutBuilder &builder)
|
||||
void SelectionAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(d->m_buttonGroup == nullptr);
|
||||
QTC_CHECK(!d->m_comboBox);
|
||||
@@ -1669,7 +1671,7 @@ MultiSelectionAspect::~MultiSelectionAspect() = default;
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void MultiSelectionAspect::addToLayout(LayoutBuilder &builder)
|
||||
void MultiSelectionAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(d->m_listView == nullptr);
|
||||
if (d->m_allValues.isEmpty())
|
||||
@@ -1778,7 +1780,7 @@ IntegerAspect::~IntegerAspect() = default;
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void IntegerAspect::addToLayout(LayoutBuilder &builder)
|
||||
void IntegerAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!d->m_spinBox);
|
||||
d->m_spinBox = createSubWidget<QSpinBox>();
|
||||
@@ -1912,7 +1914,7 @@ DoubleAspect::~DoubleAspect() = default;
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void DoubleAspect::addToLayout(LayoutBuilder &builder)
|
||||
void DoubleAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!d->m_spinBox);
|
||||
d->m_spinBox = createSubWidget<QDoubleSpinBox>();
|
||||
@@ -2066,7 +2068,7 @@ StringListAspect::~StringListAspect() = default;
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void StringListAspect::addToLayout(LayoutBuilder &builder)
|
||||
void StringListAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
Q_UNUSED(builder)
|
||||
// TODO - when needed.
|
||||
@@ -2136,7 +2138,7 @@ IntegersAspect::~IntegersAspect() = default;
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void IntegersAspect::addToLayout(LayoutBuilder &builder)
|
||||
void IntegersAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
Q_UNUSED(builder)
|
||||
// TODO - when needed.
|
||||
|
@@ -23,7 +23,7 @@ namespace Utils {
|
||||
|
||||
class AspectContainer;
|
||||
class BoolAspect;
|
||||
class LayoutBuilder;
|
||||
namespace Layouting { class LayoutBuilder; }
|
||||
|
||||
namespace Internal {
|
||||
class AspectContainerPrivate;
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
virtual void toMap(QVariantMap &map) const;
|
||||
virtual void toActiveMap(QVariantMap &map) const { toMap(map); }
|
||||
|
||||
virtual void addToLayout(LayoutBuilder &builder);
|
||||
virtual void addToLayout(Layouting::LayoutBuilder &builder);
|
||||
|
||||
virtual QVariant volatileValue() const;
|
||||
virtual void setVolatileValue(const QVariant &val);
|
||||
@@ -167,7 +167,7 @@ signals:
|
||||
protected:
|
||||
QLabel *label() const;
|
||||
void setupLabel();
|
||||
void addLabeledItem(LayoutBuilder &builder, QWidget *widget);
|
||||
void addLabeledItem(Layouting::LayoutBuilder &builder, QWidget *widget);
|
||||
|
||||
void setDataCreatorHelper(const DataCreator &creator) const;
|
||||
void setDataClonerHelper(const DataCloner &cloner) const;
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
bool value;
|
||||
};
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
QAction *action() override;
|
||||
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
SelectionAspect();
|
||||
~SelectionAspect() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
QVariant volatileValue() const override;
|
||||
void setVolatileValue(const QVariant &val) override;
|
||||
void finish() override;
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
MultiSelectionAspect();
|
||||
~MultiSelectionAspect() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
enum class DisplayStyle { ListView };
|
||||
void setDisplayStyle(DisplayStyle style);
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
FilePath filePath;
|
||||
};
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
QVariant volatileValue() const override;
|
||||
void setVolatileValue(const QVariant &val) override;
|
||||
@@ -412,7 +412,7 @@ public:
|
||||
IntegerAspect();
|
||||
~IntegerAspect() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
QVariant volatileValue() const override;
|
||||
void setVolatileValue(const QVariant &val) override;
|
||||
@@ -449,7 +449,7 @@ public:
|
||||
DoubleAspect();
|
||||
~DoubleAspect() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
QVariant volatileValue() const override;
|
||||
void setVolatileValue(const QVariant &val) override;
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
StringListAspect();
|
||||
~StringListAspect() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
QStringList value() const;
|
||||
void setValue(const QStringList &val);
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
IntegersAspect();
|
||||
~IntegersAspect() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
void emitChangedValue() override;
|
||||
|
||||
QList<int> value() const;
|
||||
@@ -561,7 +561,7 @@ public:
|
||||
InfoLabel::InfoType type = InfoLabel::None);
|
||||
~TextDisplay() override;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
void setIconType(InfoLabel::InfoType t);
|
||||
void setText(const QString &message);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <QTabWidget>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Utils {
|
||||
namespace Utils::Layouting {
|
||||
|
||||
/*!
|
||||
\enum Utils::LayoutBuilder::LayoutType
|
||||
@@ -46,21 +46,21 @@ namespace Utils {
|
||||
/*!
|
||||
Constructs a layout item instance representing an empty cell.
|
||||
*/
|
||||
LayoutBuilder::LayoutItem::LayoutItem()
|
||||
LayoutItem::LayoutItem()
|
||||
{}
|
||||
|
||||
|
||||
/*!
|
||||
Constructs a layout item proxy for \a layout.
|
||||
*/
|
||||
LayoutBuilder::LayoutItem::LayoutItem(QLayout *layout)
|
||||
LayoutItem::LayoutItem(QLayout *layout)
|
||||
: layout(layout)
|
||||
{}
|
||||
|
||||
/*!
|
||||
Constructs a layout item proxy for \a widget.
|
||||
*/
|
||||
LayoutBuilder::LayoutItem::LayoutItem(QWidget *widget)
|
||||
LayoutItem::LayoutItem(QWidget *widget)
|
||||
: widget(widget)
|
||||
{}
|
||||
|
||||
@@ -72,18 +72,18 @@ LayoutBuilder::LayoutItem::LayoutItem(QWidget *widget)
|
||||
|
||||
\sa BaseAspect::addToLayout()
|
||||
*/
|
||||
LayoutBuilder::LayoutItem::LayoutItem(BaseAspect &aspect)
|
||||
LayoutItem::LayoutItem(BaseAspect &aspect)
|
||||
: aspect(&aspect)
|
||||
{}
|
||||
|
||||
LayoutBuilder::LayoutItem::LayoutItem(BaseAspect *aspect)
|
||||
LayoutItem::LayoutItem(BaseAspect *aspect)
|
||||
: aspect(aspect)
|
||||
{}
|
||||
|
||||
/*!
|
||||
Constructs a layout item containing some static \a text.
|
||||
*/
|
||||
LayoutBuilder::LayoutItem::LayoutItem(const QString &text)
|
||||
LayoutItem::LayoutItem(const QString &text)
|
||||
: text(text)
|
||||
{}
|
||||
|
||||
@@ -147,17 +147,17 @@ static QLabel *createLabel(const QString &text)
|
||||
return label;
|
||||
}
|
||||
|
||||
static void addItemToBoxLayout(QBoxLayout *layout, const LayoutBuilder::LayoutItem &item)
|
||||
static void addItemToBoxLayout(QBoxLayout *layout, const LayoutItem &item)
|
||||
{
|
||||
if (QWidget *w = item.widget) {
|
||||
layout->addWidget(w);
|
||||
} else if (QLayout *l = item.layout) {
|
||||
layout->addLayout(l);
|
||||
} else if (item.specialType == LayoutBuilder::SpecialType::Stretch) {
|
||||
} else if (item.specialType == LayoutItem::SpecialType::Stretch) {
|
||||
layout->addStretch(item.specialValue.toInt());
|
||||
} else if (item.specialType == LayoutBuilder::SpecialType::Space) {
|
||||
} else if (item.specialType == LayoutItem::SpecialType::Space) {
|
||||
layout->addSpacing(item.specialValue.toInt());
|
||||
} else if (item.specialType == LayoutBuilder::SpecialType::HorizontalRule) {
|
||||
} else if (item.specialType == LayoutItem::SpecialType::HorizontalRule) {
|
||||
layout->addWidget(Layouting::createHr());
|
||||
} else if (!item.text.isEmpty()) {
|
||||
layout->addWidget(createLabel(item.text));
|
||||
@@ -182,7 +182,7 @@ static void flushPendingFormItems(QFormLayout *formLayout,
|
||||
addItemToBoxLayout(hbox, pendingFormItems.at(i));
|
||||
while (pendingFormItems.size() >= 2)
|
||||
pendingFormItems.pop_back();
|
||||
pendingFormItems.append(LayoutBuilder::LayoutItem(hbox));
|
||||
pendingFormItems.append(LayoutItem(hbox));
|
||||
}
|
||||
|
||||
if (pendingFormItems.size() == 1) { // One one item given, so this spans both columns.
|
||||
@@ -233,8 +233,8 @@ static void doLayoutHelper(QLayout *layout,
|
||||
auto boxLayout = qobject_cast<QBoxLayout *>(layout);
|
||||
auto stackLayout = qobject_cast<QStackedLayout *>(layout);
|
||||
|
||||
for (const LayoutBuilder::LayoutItem &item : items) {
|
||||
if (item.specialType == LayoutBuilder::SpecialType::Break) {
|
||||
for (const LayoutItem &item : items) {
|
||||
if (item.specialType == LayoutItem::SpecialType::Break) {
|
||||
if (formLayout)
|
||||
flushPendingFormItems(formLayout, pendingFormItems);
|
||||
else if (gridLayout) {
|
||||
@@ -276,7 +276,7 @@ static void doLayoutHelper(QLayout *layout,
|
||||
/*!
|
||||
Constructs a layout item from the contents of another LayoutBuilder
|
||||
*/
|
||||
LayoutBuilder::LayoutItem::LayoutItem(const LayoutBuilder &builder)
|
||||
LayoutItem::LayoutItem(const LayoutBuilder &builder)
|
||||
{
|
||||
layout = builder.createLayout();
|
||||
doLayoutHelper(layout, builder.m_items, Layouting::WithoutMargins);
|
||||
@@ -369,7 +369,7 @@ LayoutBuilder &LayoutBuilder::addRow(const LayoutItems &items)
|
||||
LayoutBuilder &LayoutBuilder::addItem(const LayoutItem &item)
|
||||
{
|
||||
if (item.aspect) {
|
||||
item.aspect->addToLayout(*this);
|
||||
// item.aspect->addToLayout(*this);
|
||||
if (m_layoutType == FormLayout || m_layoutType == VBoxLayout)
|
||||
finishRow();
|
||||
} else {
|
||||
@@ -438,49 +438,47 @@ LayoutExtender::~LayoutExtender()
|
||||
|
||||
// Special items
|
||||
|
||||
LayoutBuilder::Break::Break()
|
||||
Break::Break()
|
||||
{
|
||||
specialType = SpecialType::Break;
|
||||
}
|
||||
|
||||
LayoutBuilder::Stretch::Stretch(int stretch)
|
||||
Stretch::Stretch(int stretch)
|
||||
{
|
||||
specialType = SpecialType::Stretch;
|
||||
specialValue = stretch;
|
||||
}
|
||||
|
||||
LayoutBuilder::Space::Space(int space)
|
||||
Space::Space(int space)
|
||||
{
|
||||
specialType = SpecialType::Space;
|
||||
specialValue = space;
|
||||
}
|
||||
|
||||
LayoutBuilder::Span::Span(int span_, const LayoutItem &item)
|
||||
Span::Span(int span_, const LayoutItem &item)
|
||||
{
|
||||
LayoutBuilder::LayoutItem::operator=(item);
|
||||
LayoutItem::operator=(item);
|
||||
span = span_;
|
||||
}
|
||||
|
||||
LayoutBuilder::Tab::Tab(const QString &tabName, const LayoutBuilder &item)
|
||||
Tab::Tab(const QString &tabName, const LayoutBuilder &item)
|
||||
{
|
||||
text = tabName;
|
||||
widget = new QWidget;
|
||||
item.attachTo(widget);
|
||||
}
|
||||
|
||||
LayoutBuilder::HorizontalRule::HorizontalRule()
|
||||
HorizontalRule::HorizontalRule()
|
||||
{
|
||||
specialType = SpecialType::HorizontalRule;
|
||||
}
|
||||
|
||||
namespace Layouting {
|
||||
|
||||
// "Widgets"
|
||||
|
||||
static void applyItems(QWidget *widget, const QList<LayoutBuilder::LayoutItem> &items)
|
||||
static void applyItems(QWidget *widget, const QList<LayoutItem> &items)
|
||||
{
|
||||
bool hadLayout = false;
|
||||
for (const LayoutBuilder::LayoutItem &item : items) {
|
||||
for (const LayoutItem &item : items) {
|
||||
if (item.setter) {
|
||||
item.setter(widget);
|
||||
} else if (item.layout && !hadLayout) {
|
||||
@@ -526,7 +524,7 @@ TabWidget::TabWidget(QTabWidget *tabWidget, std::initializer_list<Tab> tabs)
|
||||
|
||||
// "Properties"
|
||||
|
||||
LayoutBuilder::Setter title(const QString &title, BoolAspect *checker)
|
||||
LayoutItem::Setter title(const QString &title, BoolAspect *checker)
|
||||
{
|
||||
return [title, checker](QObject *target) {
|
||||
if (auto groupBox = qobject_cast<QGroupBox *>(target)) {
|
||||
@@ -543,7 +541,7 @@ LayoutBuilder::Setter title(const QString &title, BoolAspect *checker)
|
||||
};
|
||||
}
|
||||
|
||||
LayoutBuilder::Setter onClicked(const std::function<void ()> &func, QObject *guard)
|
||||
LayoutItem::Setter onClicked(const std::function<void ()> &func, QObject *guard)
|
||||
{
|
||||
return [func, guard](QObject *target) {
|
||||
if (auto button = qobject_cast<QAbstractButton *>(target)) {
|
||||
@@ -554,7 +552,7 @@ LayoutBuilder::Setter onClicked(const std::function<void ()> &func, QObject *gua
|
||||
};
|
||||
}
|
||||
|
||||
LayoutBuilder::Setter text(const QString &text)
|
||||
LayoutItem::Setter text(const QString &text)
|
||||
{
|
||||
return [text](QObject *target) {
|
||||
if (auto button = qobject_cast<QAbstractButton *>(target)) {
|
||||
@@ -565,7 +563,7 @@ LayoutBuilder::Setter text(const QString &text)
|
||||
};
|
||||
}
|
||||
|
||||
LayoutBuilder::Setter tooltip(const QString &toolTip)
|
||||
LayoutItem::Setter tooltip(const QString &toolTip)
|
||||
{
|
||||
return [toolTip](QObject *target) {
|
||||
if (auto widget = qobject_cast<QWidget *>(target)) {
|
||||
@@ -584,10 +582,10 @@ QWidget *createHr(QWidget *parent)
|
||||
return frame;
|
||||
}
|
||||
|
||||
LayoutBuilder::Break br;
|
||||
LayoutBuilder::Stretch st;
|
||||
LayoutBuilder::Space empty(0);
|
||||
LayoutBuilder::HorizontalRule hr;
|
||||
// Singletons.
|
||||
Break br;
|
||||
Stretch st;
|
||||
Space empty(0);
|
||||
HorizontalRule hr;
|
||||
|
||||
} // Layouting
|
||||
} // Utils
|
||||
} // Utils::Layouting
|
||||
|
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
@@ -20,11 +19,11 @@ class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class BaseAspect;
|
||||
class BoolAspect;
|
||||
} // Utils
|
||||
|
||||
namespace Layouting {
|
||||
namespace Utils::Layouting {
|
||||
|
||||
enum AttachType {
|
||||
WithMargins,
|
||||
@@ -32,19 +31,13 @@ enum AttachType {
|
||||
WithFormAlignment, // Handle Grid similar to QFormLayout, i.e. use special alignment for the first column on Mac
|
||||
};
|
||||
|
||||
} // Layouting
|
||||
class LayoutBuilder;
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT LayoutBuilder
|
||||
// LayoutItem
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT LayoutItem
|
||||
{
|
||||
public:
|
||||
enum LayoutType {
|
||||
HBoxLayout,
|
||||
VBoxLayout,
|
||||
FormLayout,
|
||||
GridLayout,
|
||||
StackLayout,
|
||||
};
|
||||
|
||||
enum class AlignmentType {
|
||||
DefaultAlignment,
|
||||
AlignAsFormLabel,
|
||||
@@ -59,29 +52,123 @@ public:
|
||||
};
|
||||
|
||||
using Setter = std::function<void(QObject *target)>;
|
||||
LayoutItem();
|
||||
LayoutItem(QLayout *layout);
|
||||
LayoutItem(QWidget *widget);
|
||||
LayoutItem(BaseAspect *aspect); // Remove
|
||||
LayoutItem(BaseAspect &aspect);
|
||||
LayoutItem(const QString &text);
|
||||
LayoutItem(const LayoutBuilder &builder);
|
||||
LayoutItem(const Setter &setter) { this->setter = setter; }
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT LayoutItem
|
||||
{
|
||||
public:
|
||||
LayoutItem();
|
||||
LayoutItem(QLayout *layout);
|
||||
LayoutItem(QWidget *widget);
|
||||
LayoutItem(BaseAspect *aspect); // Remove
|
||||
LayoutItem(BaseAspect &aspect);
|
||||
LayoutItem(const QString &text);
|
||||
LayoutItem(const LayoutBuilder &builder);
|
||||
LayoutItem(const Setter &setter) { this->setter = setter; }
|
||||
QLayout *layout = nullptr;
|
||||
QWidget *widget = nullptr;
|
||||
BaseAspect *aspect = nullptr;
|
||||
|
||||
QLayout *layout = nullptr;
|
||||
QWidget *widget = nullptr;
|
||||
BaseAspect *aspect = nullptr;
|
||||
QString text; // FIXME: Use specialValue for that
|
||||
int span = 1;
|
||||
AlignmentType align = AlignmentType::DefaultAlignment;
|
||||
Setter setter;
|
||||
SpecialType specialType = SpecialType::NotSpecial;
|
||||
QVariant specialValue;
|
||||
};
|
||||
|
||||
QString text; // FIXME: Use specialValue for that
|
||||
int span = 1;
|
||||
AlignmentType align = AlignmentType::DefaultAlignment;
|
||||
Setter setter;
|
||||
SpecialType specialType = SpecialType::NotSpecial;
|
||||
QVariant specialValue;
|
||||
class QTCREATOR_UTILS_EXPORT Space : public LayoutItem
|
||||
{
|
||||
public:
|
||||
explicit Space(int space);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Span : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Span(int span, const LayoutItem &item);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Stretch : public LayoutItem
|
||||
{
|
||||
public:
|
||||
explicit Stretch(int stretch = 1);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Tab : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Tab(const QString &tabName, const LayoutBuilder &item);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Break : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Break();
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT HorizontalRule : public LayoutItem
|
||||
{
|
||||
public:
|
||||
HorizontalRule();
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Group : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Group(std::initializer_list<LayoutItem> items);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT PushButton : public LayoutItem
|
||||
{
|
||||
public:
|
||||
PushButton(std::initializer_list<LayoutItem> items);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Splitter : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Splitter(std::initializer_list<LayoutItem> items);
|
||||
Splitter(QSplitter *splitter, std::initializer_list<LayoutItem> items);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT TabWidget : public LayoutItem
|
||||
{
|
||||
public:
|
||||
TabWidget(std::initializer_list<Tab> tabs);
|
||||
TabWidget(QTabWidget *tabWidget, std::initializer_list<Tab> tabs);
|
||||
};
|
||||
|
||||
// Singleton items.
|
||||
|
||||
QTCREATOR_UTILS_EXPORT extern Break br;
|
||||
QTCREATOR_UTILS_EXPORT extern Stretch st;
|
||||
QTCREATOR_UTILS_EXPORT extern Space empty;
|
||||
QTCREATOR_UTILS_EXPORT extern HorizontalRule hr;
|
||||
|
||||
// "Properties"
|
||||
|
||||
QTCREATOR_UTILS_EXPORT LayoutItem::Setter title(const QString &title,
|
||||
BoolAspect *checker = nullptr);
|
||||
|
||||
QTCREATOR_UTILS_EXPORT LayoutItem::Setter text(const QString &text);
|
||||
QTCREATOR_UTILS_EXPORT LayoutItem::Setter tooltip(const QString &toolTip);
|
||||
QTCREATOR_UTILS_EXPORT LayoutItem::Setter onClicked(const std::function<void()> &func,
|
||||
QObject *guard = nullptr);
|
||||
|
||||
|
||||
// Convenience
|
||||
|
||||
QTCREATOR_UTILS_EXPORT QWidget *createHr(QWidget *parent = nullptr);
|
||||
|
||||
|
||||
// LayoutBuilder
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT LayoutBuilder
|
||||
{
|
||||
public:
|
||||
enum LayoutType {
|
||||
HBoxLayout,
|
||||
VBoxLayout,
|
||||
FormLayout,
|
||||
GridLayout,
|
||||
StackLayout,
|
||||
};
|
||||
|
||||
using LayoutItems = QList<LayoutItem>;
|
||||
@@ -109,43 +196,9 @@ public:
|
||||
void attachTo(QWidget *w, Layouting::AttachType attachType = Layouting::WithMargins) const;
|
||||
QWidget *emerge(Layouting::AttachType attachType = Layouting::WithMargins);
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Space : public LayoutItem
|
||||
{
|
||||
public:
|
||||
explicit Space(int space);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Span : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Span(int span, const LayoutItem &item);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Stretch : public LayoutItem
|
||||
{
|
||||
public:
|
||||
explicit Stretch(int stretch = 1);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Tab : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Tab(const QString &tabName, const LayoutBuilder &item);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Break : public LayoutItem
|
||||
{
|
||||
public:
|
||||
Break();
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT HorizontalRule : public LayoutItem
|
||||
{
|
||||
public:
|
||||
HorizontalRule();
|
||||
};
|
||||
|
||||
protected:
|
||||
friend class LayoutItem;
|
||||
|
||||
explicit LayoutBuilder(); // Adds to existing layout.
|
||||
|
||||
QLayout *createLayout() const;
|
||||
@@ -167,47 +220,6 @@ private:
|
||||
Layouting::AttachType m_attachType = {};
|
||||
};
|
||||
|
||||
namespace Layouting {
|
||||
|
||||
using Space = LayoutBuilder::Space;
|
||||
using Span = LayoutBuilder::Span;
|
||||
using Tab = LayoutBuilder::Tab;
|
||||
|
||||
QTCREATOR_UTILS_EXPORT LayoutBuilder::Setter title(const QString &title,
|
||||
BoolAspect *checker = nullptr);
|
||||
|
||||
QTCREATOR_UTILS_EXPORT LayoutBuilder::Setter text(const QString &text);
|
||||
QTCREATOR_UTILS_EXPORT LayoutBuilder::Setter tooltip(const QString &toolTip);
|
||||
QTCREATOR_UTILS_EXPORT LayoutBuilder::Setter onClicked(const std::function<void()> &func,
|
||||
QObject *guard = nullptr);
|
||||
QTCREATOR_UTILS_EXPORT QWidget *createHr(QWidget *parent = nullptr);
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Group : public LayoutBuilder::LayoutItem
|
||||
{
|
||||
public:
|
||||
Group(std::initializer_list<LayoutItem> items);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT PushButton : public LayoutBuilder::LayoutItem
|
||||
{
|
||||
public:
|
||||
PushButton(std::initializer_list<LayoutItem> items);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Splitter : public LayoutBuilder::LayoutItem
|
||||
{
|
||||
public:
|
||||
Splitter(std::initializer_list<LayoutItem> items);
|
||||
Splitter(QSplitter *splitter, std::initializer_list<LayoutItem> items);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT TabWidget : public LayoutBuilder::LayoutItem
|
||||
{
|
||||
public:
|
||||
TabWidget(std::initializer_list<Tab> tabs);
|
||||
TabWidget(QTabWidget *tabWidget, std::initializer_list<Tab> tabs);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Column : public LayoutBuilder
|
||||
{
|
||||
public:
|
||||
@@ -243,10 +255,4 @@ public:
|
||||
Stack(std::initializer_list<LayoutItem> items) : LayoutBuilder(StackLayout, items) {}
|
||||
};
|
||||
|
||||
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Break br;
|
||||
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Stretch st;
|
||||
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::Space empty;
|
||||
QTCREATOR_UTILS_EXPORT extern LayoutBuilder::HorizontalRule hr;
|
||||
|
||||
} // Layouting
|
||||
} // Utils
|
||||
} // Utils::Layouting
|
||||
|
@@ -50,6 +50,7 @@
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
using namespace Utils::Layouting;
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
|
||||
|
@@ -30,7 +30,7 @@ public:
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
void toMap(QVariantMap &map) const override;
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
QVariant volatileValue() const override;
|
||||
void setVolatileValue(const QVariant &val) override;
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override
|
||||
{
|
||||
addMutableAction(m_comboBox);
|
||||
builder.addItem(m_comboBox);
|
||||
|
@@ -46,7 +46,7 @@ class DebuggerLanguageAspect : public BaseAspect
|
||||
public:
|
||||
DebuggerLanguageAspect() = default;
|
||||
|
||||
void addToLayout(LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
bool value() const;
|
||||
void setValue(bool val);
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
std::function<void(bool)> m_clickCallBack;
|
||||
};
|
||||
|
||||
void DebuggerLanguageAspect::addToLayout(LayoutBuilder &builder)
|
||||
void DebuggerLanguageAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!m_checkBox);
|
||||
m_checkBox = new QCheckBox(m_label);
|
||||
|
@@ -491,7 +491,7 @@ void SourcePathMapAspect::toMap(QVariantMap &) const
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
|
||||
void SourcePathMapAspect::addToLayout(LayoutBuilder &builder)
|
||||
void SourcePathMapAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!d->m_widget);
|
||||
d->m_widget = createSubWidget<DebuggerSourcePathMappingWidget>();
|
||||
|
@@ -110,7 +110,7 @@ void CommandBuilderAspectPrivate::tryToMigrate()
|
||||
}
|
||||
}
|
||||
|
||||
void CommandBuilderAspect::addToLayout(LayoutBuilder &builder)
|
||||
void CommandBuilderAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
if (!d->commandBuilder) {
|
||||
d->commandBuilder = new QComboBox;
|
||||
|
@@ -23,7 +23,7 @@ public:
|
||||
QString fullCommandFlag(bool keepJobNum) const;
|
||||
|
||||
private:
|
||||
void addToLayout(Utils::LayoutBuilder &builder) final;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) final;
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
|
||||
|
@@ -324,7 +324,7 @@ IosDeviceTypeAspect::IosDeviceTypeAspect(IosRunConfiguration *runConfiguration)
|
||||
this, &IosDeviceTypeAspect::deviceChanges);
|
||||
}
|
||||
|
||||
void IosDeviceTypeAspect::addToLayout(LayoutBuilder &builder)
|
||||
void IosDeviceTypeAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
m_deviceTypeComboBox = new QComboBox;
|
||||
m_deviceTypeComboBox->setModel(&m_deviceTypeModel);
|
||||
|
@@ -27,7 +27,7 @@ public:
|
||||
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
void toMap(QVariantMap &map) const override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
IosDeviceType deviceType() const;
|
||||
void setDeviceType(const IosDeviceType &deviceType);
|
||||
|
@@ -21,7 +21,7 @@ public:
|
||||
|
||||
void makeReadOnly() override {}
|
||||
void refresh() override {}
|
||||
void addToLayout(Utils::LayoutBuilder &) override {}
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &) override {}
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
@@ -36,7 +36,7 @@ private:
|
||||
|
||||
void makeReadOnly() override { m_toolsComboBox->setEnabled(false); }
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override
|
||||
{
|
||||
addMutableAction(m_toolsComboBox);
|
||||
builder.addItem(m_toolsComboBox);
|
||||
|
@@ -108,7 +108,7 @@ void BuildDirectoryAspect::fromMap(const QVariantMap &map)
|
||||
}
|
||||
}
|
||||
|
||||
void BuildDirectoryAspect::addToLayout(LayoutBuilder &builder)
|
||||
void BuildDirectoryAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
StringAspect::addToLayout(builder);
|
||||
d->problemLabel = new InfoLabel({}, InfoLabel::Warning);
|
||||
|
@@ -23,7 +23,7 @@ public:
|
||||
bool isShadowBuild() const;
|
||||
void setProblem(const QString &description);
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
static Utils::FilePath fixupDir(const Utils::FilePath &dir);
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include <QVBoxLayout>
|
||||
|
||||
using namespace Utils;
|
||||
using namespace Utils::Layouting;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
|
@@ -750,7 +750,7 @@ void KitAspectWidget::addToLayoutWithLabel(QWidget *parent)
|
||||
emit labelLinkActivated(link);
|
||||
});
|
||||
|
||||
LayoutExtender builder(parent->layout(), Layouting::WithFormAlignment);
|
||||
Layouting::LayoutExtender builder(parent->layout(), Layouting::WithFormAlignment);
|
||||
builder.finishRow();
|
||||
builder.addItem(label);
|
||||
addToLayout(builder);
|
||||
|
@@ -24,7 +24,6 @@ QT_END_NAMESPACE
|
||||
namespace Utils {
|
||||
class Environment;
|
||||
class FilePath;
|
||||
class LayoutBuilder;
|
||||
class MacroExpander;
|
||||
class OutputLineParser;
|
||||
} // namespace Utils
|
||||
|
@@ -573,7 +573,7 @@ public:
|
||||
|
||||
delete layout();
|
||||
|
||||
LayoutBuilder builder(LayoutBuilder::GridLayout);
|
||||
Layouting::LayoutBuilder builder(Layouting::LayoutBuilder::GridLayout);
|
||||
for (KitAspect *aspect : KitManager::kitAspects()) {
|
||||
if (k && k->isMutable(aspect->id())) {
|
||||
KitAspectWidget *widget = aspect->createConfigWidget(k);
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <QPushButton>
|
||||
|
||||
using namespace Utils;
|
||||
using namespace Utils::Layouting;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class PROJECTEXPLORER_EXPORT TerminalAspect : public Utils::BaseAspect
|
||||
public:
|
||||
TerminalAspect();
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
bool useTerminal() const;
|
||||
void setUseTerminalHint(bool useTerminal);
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
explicit WorkingDirectoryAspect(const Utils::MacroExpander *expander,
|
||||
EnvironmentAspect *envAspect);
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
Utils::FilePath workingDirectory() const;
|
||||
Utils::FilePath defaultWorkingDirectory() const;
|
||||
@@ -91,7 +91,7 @@ class PROJECTEXPLORER_EXPORT ArgumentsAspect : public Utils::BaseAspect
|
||||
public:
|
||||
explicit ArgumentsAspect(const Utils::MacroExpander *macroExpander);
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
QString arguments() const;
|
||||
QString unexpandedArguments() const;
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
|
||||
void setSettingsKey(const QString &key);
|
||||
void makeOverridable(const QString &overridingKey, const QString &useOverridableKey);
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
void setLabelText(const QString &labelText);
|
||||
void setPlaceHolderText(const QString &placeHolderText);
|
||||
void setHistoryCompleter(const QString &historyCompleterKey);
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
|
||||
void fromMap(const QVariantMap &) override;
|
||||
void toMap(QVariantMap &) const override;
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
struct Data : Utils::BaseAspect::Data { Interpreter interpreter; };
|
||||
|
||||
|
@@ -63,7 +63,7 @@ public:
|
||||
ArchitecturesAspect();
|
||||
|
||||
void setKit(const ProjectExplorer::Kit *kit) { m_kit = kit; }
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override;
|
||||
QStringList selectedArchitectures() const;
|
||||
void setSelectedArchitectures(const QStringList& architectures);
|
||||
bool isManagedByTarget() const { return m_isManagedByTarget; }
|
||||
@@ -86,7 +86,7 @@ ArchitecturesAspect::ArchitecturesAspect()
|
||||
setAllValues(m_abisToArchMap.keys());
|
||||
}
|
||||
|
||||
void ArchitecturesAspect::addToLayout(LayoutBuilder &builder)
|
||||
void ArchitecturesAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
MultiSelectionAspect::addToLayout(builder);
|
||||
const auto changeHandler = [this] {
|
||||
|
@@ -35,7 +35,7 @@ private:
|
||||
void makeReadOnly() override { m_changeButton->setEnabled(false); }
|
||||
void refresh() override { m_contentLabel->setText(QbsKitAspect::representation(kit())); }
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override
|
||||
{
|
||||
addMutableAction(m_contentLabel);
|
||||
builder.addItem(m_contentLabel);
|
||||
|
@@ -40,7 +40,7 @@ public:
|
||||
~QmakeKitAspectWidget() override { delete m_lineEdit; }
|
||||
|
||||
private:
|
||||
void addToLayout(LayoutBuilder &builder) override
|
||||
void addToLayout(Layouting::LayoutBuilder &builder) override
|
||||
{
|
||||
addMutableAction(m_lineEdit);
|
||||
builder.addItem(m_lineEdit);
|
||||
|
@@ -55,7 +55,7 @@ QmlMainFileAspect::~QmlMainFileAspect()
|
||||
delete m_fileListCombo;
|
||||
}
|
||||
|
||||
void QmlMainFileAspect::addToLayout(LayoutBuilder &builder)
|
||||
void QmlMainFileAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_ASSERT(!m_fileListCombo, delete m_fileListCombo);
|
||||
m_fileListCombo = new QComboBox;
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
QString currentFile;
|
||||
};
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) final;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
|
||||
|
@@ -30,7 +30,7 @@ QmlDebuggingAspect::QmlDebuggingAspect(BuildConfiguration *buildConfig)
|
||||
setValue(ProjectExplorerPlugin::buildPropertiesSettings().qmlDebugging.value());
|
||||
}
|
||||
|
||||
void QmlDebuggingAspect::addToLayout(LayoutBuilder &builder)
|
||||
void QmlDebuggingAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
SelectionAspect::addToLayout(builder);
|
||||
const auto warningLabel = createSubWidget<InfoLabel>(QString(), InfoLabel::Warning);
|
||||
@@ -67,7 +67,7 @@ QtQuickCompilerAspect::QtQuickCompilerAspect(BuildConfiguration *buildConfig)
|
||||
setValue(ProjectExplorerPlugin::buildPropertiesSettings().qtQuickCompiler.value());
|
||||
}
|
||||
|
||||
void QtQuickCompilerAspect::addToLayout(LayoutBuilder &builder)
|
||||
void QtQuickCompilerAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
SelectionAspect::addToLayout(builder);
|
||||
const auto warningLabel = createSubWidget<InfoLabel>(QString(), InfoLabel::Warning);
|
||||
|
@@ -18,7 +18,7 @@ class QTSUPPORT_EXPORT QmlDebuggingAspect : public Utils::TriStateAspect
|
||||
public:
|
||||
explicit QmlDebuggingAspect(ProjectExplorer::BuildConfiguration *buildConfig);
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
private:
|
||||
const ProjectExplorer::BuildConfiguration *m_buildConfig = nullptr;
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
QtQuickCompilerAspect(ProjectExplorer::BuildConfiguration *buildConfig);
|
||||
|
||||
private:
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
const ProjectExplorer::BuildConfiguration *m_buildConfig = nullptr;
|
||||
};
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
private:
|
||||
void makeReadOnly() final { m_combo->setEnabled(false); }
|
||||
|
||||
void addToLayout(LayoutBuilder &builder)
|
||||
void addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
addMutableAction(m_combo);
|
||||
builder.addItem(m_combo);
|
||||
|
@@ -128,7 +128,7 @@ void SuppressionAspect::setValue(const FilePaths &val)
|
||||
BaseAspect::setValue(Utils::transform<QStringList>(val, &FilePath::toString));
|
||||
}
|
||||
|
||||
void SuppressionAspect::addToLayout(LayoutBuilder &builder)
|
||||
void SuppressionAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!d->addEntry);
|
||||
QTC_CHECK(!d->removeEntry);
|
||||
|
@@ -23,7 +23,7 @@ public:
|
||||
Utils::FilePaths value() const;
|
||||
void setValue(const Utils::FilePaths &val);
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) final;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) final;
|
||||
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
void toMap(QVariantMap &map) const final;
|
||||
|
@@ -73,7 +73,7 @@ WebBrowserSelectionAspect::WebBrowserSelectionAspect(ProjectExplorer::Target *ta
|
||||
addDataExtractor(this, &WebBrowserSelectionAspect::currentBrowser, &Data::currentBrowser);
|
||||
}
|
||||
|
||||
void WebBrowserSelectionAspect::addToLayout(LayoutBuilder &builder)
|
||||
void WebBrowserSelectionAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
{
|
||||
QTC_CHECK(!m_webBrowserComboBox);
|
||||
m_webBrowserComboBox = new QComboBox;
|
||||
|
@@ -20,7 +20,7 @@ class WebBrowserSelectionAspect : public Utils::BaseAspect
|
||||
public:
|
||||
WebBrowserSelectionAspect(ProjectExplorer::Target *target);
|
||||
|
||||
void addToLayout(Utils::LayoutBuilder &builder) override;
|
||||
void addToLayout(Utils::Layouting::LayoutBuilder &builder) override;
|
||||
|
||||
void fromMap(const QVariantMap &map) override;
|
||||
void toMap(QVariantMap &map) const override;
|
||||
|
@@ -184,6 +184,7 @@ Tasking::WorkflowPolicy GroupWidget::workflowPolicy() const
|
||||
return m_workflowPolicy;
|
||||
}
|
||||
|
||||
TaskGroup::TaskGroup(QWidget *group, std::initializer_list<LayoutBuilder::LayoutItem> items)
|
||||
: Row({ group, Group { Column { items } } }) {}
|
||||
TaskGroup::TaskGroup(QWidget *group, std::initializer_list<LayoutItem> items)
|
||||
: Row({ group, Group { Column { items } } })
|
||||
{}
|
||||
|
||||
|
@@ -79,5 +79,5 @@ private:
|
||||
class TaskGroup : public Utils::Layouting::Row
|
||||
{
|
||||
public:
|
||||
TaskGroup(QWidget *group, std::initializer_list<Utils::LayoutBuilder::LayoutItem> items);
|
||||
TaskGroup(QWidget *group, std::initializer_list<Utils::Layouting::LayoutItem> items);
|
||||
};
|
||||
|
Reference in New Issue
Block a user