forked from qt-creator/qt-creator
Utils: Make Layouting::Group { .. } less weird
It had a implicit vertical layout leading to unneded layout nesting
in quite a few cases. The price is an added Column { ... } in those
places where the implicit vertical layout was sufficient before.
Change-Id: I3ae1f03f9c1d691bd0c563b0447edd03ee02bbd2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -110,7 +110,7 @@ public:
|
||||
|
||||
LayoutType layoutType() const { return m_layoutType; }
|
||||
|
||||
void attachTo(QWidget *w, bool withMargins = true);
|
||||
void attachTo(QWidget *w, bool withMargins = true) const;
|
||||
QWidget *emerge(bool withMargins = true);
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Space : public LayoutItem
|
||||
@@ -153,12 +153,11 @@ protected:
|
||||
explicit LayoutBuilder(); // Adds to existing layout.
|
||||
|
||||
QLayout *createLayout() const;
|
||||
void doLayout(QWidget *parent);
|
||||
void doLayout(QWidget *parent, bool withMargins) const;
|
||||
|
||||
LayoutItems m_items;
|
||||
LayoutType m_layoutType;
|
||||
Utils::optional<int> m_spacing;
|
||||
bool m_withMargins = false;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT LayoutExtender : public LayoutBuilder
|
||||
@@ -176,7 +175,8 @@ namespace Layouting {
|
||||
class QTCREATOR_UTILS_EXPORT Group : public LayoutBuilder::LayoutItem
|
||||
{
|
||||
public:
|
||||
Group(std::initializer_list<LayoutBuilder::LayoutItem> items);
|
||||
explicit Group(const LayoutBuilder &innerLayout);
|
||||
Group(const LayoutBuilder::Title &title, const LayoutBuilder &innerLayout);
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT Column : public LayoutBuilder
|
||||
|
||||
Reference in New Issue
Block a user