1// qformlayout.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QFormLayout : QLayout
24{
25%TypeHeaderCode
26#include <qformlayout.h>
27%End
28
29public:
30    enum FieldGrowthPolicy
31    {
32        FieldsStayAtSizeHint,
33        ExpandingFieldsGrow,
34        AllNonFixedFieldsGrow,
35    };
36
37    enum RowWrapPolicy
38    {
39        DontWrapRows,
40        WrapLongRows,
41        WrapAllRows,
42    };
43
44    enum ItemRole
45    {
46        LabelRole,
47        FieldRole,
48        SpanningRole,
49    };
50
51    explicit QFormLayout(QWidget *parent /TransferThis/ = 0);
52    virtual ~QFormLayout();
53    void setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy);
54    QFormLayout::FieldGrowthPolicy fieldGrowthPolicy() const;
55    void setRowWrapPolicy(QFormLayout::RowWrapPolicy policy);
56    QFormLayout::RowWrapPolicy rowWrapPolicy() const;
57    void setLabelAlignment(Qt::Alignment alignment);
58    Qt::Alignment labelAlignment() const;
59    void setFormAlignment(Qt::Alignment alignment);
60    Qt::Alignment formAlignment() const;
61    void setHorizontalSpacing(int spacing);
62    int horizontalSpacing() const;
63    void setVerticalSpacing(int spacing);
64    int verticalSpacing() const;
65    int spacing() const;
66    void setSpacing(int);
67    void addRow(QWidget *label /Transfer/, QWidget *field /Transfer/);
68    void addRow(QWidget *label /Transfer/, QLayout *field /Transfer/);
69    void addRow(const QString &labelText, QWidget *field /Transfer/);
70    void addRow(const QString &labelText, QLayout *field /Transfer/);
71    void addRow(QWidget *widget /Transfer/);
72    void addRow(QLayout *layout /Transfer/);
73    void insertRow(int row, QWidget *label /Transfer/, QWidget *field /Transfer/);
74    void insertRow(int row, QWidget *label /Transfer/, QLayout *field /Transfer/);
75    void insertRow(int row, const QString &labelText, QWidget *field /Transfer/);
76    void insertRow(int row, const QString &labelText, QLayout *field /Transfer/);
77    void insertRow(int row, QWidget *widget /Transfer/);
78    void insertRow(int row, QLayout *layout /Transfer/);
79    void setItem(int row, QFormLayout::ItemRole role, QLayoutItem *item /Transfer/);
80    void setWidget(int row, QFormLayout::ItemRole role, QWidget *widget /Transfer/);
81    void setLayout(int row, QFormLayout::ItemRole role, QLayout *layout /Transfer/);
82    QLayoutItem *itemAt(int row, QFormLayout::ItemRole role) const;
83    void getItemPosition(int index, int *rowPtr, QFormLayout::ItemRole *rolePtr) const;
84    void getWidgetPosition(QWidget *widget, int *rowPtr, QFormLayout::ItemRole *rolePtr) const;
85    void getLayoutPosition(QLayout *layout, int *rowPtr, QFormLayout::ItemRole *rolePtr) const;
86    QWidget *labelForField(QWidget *field) const;
87    QWidget *labelForField(QLayout *field) const;
88    virtual void addItem(QLayoutItem *item /Transfer/);
89    virtual QLayoutItem *itemAt(int index) const;
90    virtual QLayoutItem *takeAt(int index) /TransferBack/;
91    virtual void setGeometry(const QRect &rect);
92    virtual QSize minimumSize() const;
93    virtual QSize sizeHint() const;
94    virtual void invalidate();
95    virtual bool hasHeightForWidth() const;
96    virtual int heightForWidth(int width) const;
97    virtual Qt::Orientations expandingDirections() const;
98    virtual int count() const;
99    int rowCount() const;
100%If (Qt_5_8_0 -)
101
102    struct TakeRowResult
103    {
104%TypeHeaderCode
105#include <qformlayout.h>
106%End
107
108        QLayoutItem *labelItem;
109        QLayoutItem *fieldItem;
110    };
111
112%End
113%If (Qt_5_8_0 -)
114    void removeRow(int row);
115%End
116%If (Qt_5_8_0 -)
117    void removeRow(QWidget *widget);
118%End
119%If (Qt_5_8_0 -)
120    void removeRow(QLayout *layout);
121%End
122%If (Qt_5_8_0 -)
123    QFormLayout::TakeRowResult takeRow(int row);
124%End
125%If (Qt_5_8_0 -)
126    QFormLayout::TakeRowResult takeRow(QWidget *widget);
127%End
128%If (Qt_5_8_0 -)
129    QFormLayout::TakeRowResult takeRow(QLayout *layout);
130%End
131};
132