Layouting: Handle attach types via setter

Change-Id: I862f5cd109db3582b4f029787ec0cded2da39ce6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-05-02 12:51:03 +02:00
parent 70b02d23e1
commit 50084f6b0e
65 changed files with 265 additions and 160 deletions

View File

@@ -24,12 +24,6 @@ QT_END_NAMESPACE
namespace Layouting {
enum AttachType {
WithMargins,
WithoutMargins,
WithFormAlignment, // Handle Grid similar to QFormLayout, i.e. use special alignment for the first column on Mac
};
class LayoutBuilder;
class LayoutItem;
class Span;
@@ -88,8 +82,8 @@ public:
createItem(this, t);
}
void attachTo(QWidget *w, AttachType attachType = WithMargins) const;
QWidget *emerge(AttachType attachType = WithMargins);
void attachTo(QWidget *w) const;
QWidget *emerge();
void addItem(const LayoutItem &item);
void addItems(const LayoutItems &items);
@@ -193,6 +187,9 @@ QTCREATOR_UTILS_EXPORT LayoutItem br();
QTCREATOR_UTILS_EXPORT LayoutItem st();
QTCREATOR_UTILS_EXPORT LayoutItem empty();
QTCREATOR_UTILS_EXPORT LayoutItem hr();
QTCREATOR_UTILS_EXPORT LayoutItem noMargin();
QTCREATOR_UTILS_EXPORT LayoutItem normalMargin();
QTCREATOR_UTILS_EXPORT LayoutItem withFormAlignment();
// "Properties"
@@ -238,7 +235,7 @@ public:
class QTCREATOR_UTILS_EXPORT LayoutExtender : public LayoutBuilder
{
public:
explicit LayoutExtender(QLayout *layout, AttachType attachType);
explicit LayoutExtender(QLayout *layout);
~LayoutExtender();
};