1// qgraphicsgridlayout.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 QGraphicsGridLayout : QGraphicsLayout
24{
25%TypeHeaderCode
26#include <qgraphicsgridlayout.h>
27%End
28
29public:
30    QGraphicsGridLayout(QGraphicsLayoutItem *parent /TransferThis/ = 0);
31    virtual ~QGraphicsGridLayout();
32    void addItem(QGraphicsLayoutItem *item /Transfer/, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = Qt::Alignment());
33    void addItem(QGraphicsLayoutItem *item /Transfer/, int row, int column, Qt::Alignment alignment = Qt::Alignment());
34    void setHorizontalSpacing(qreal spacing);
35    qreal horizontalSpacing() const;
36    void setVerticalSpacing(qreal spacing);
37    qreal verticalSpacing() const;
38    void setSpacing(qreal spacing);
39    void setRowSpacing(int row, qreal spacing);
40    qreal rowSpacing(int row) const;
41    void setColumnSpacing(int column, qreal spacing);
42    qreal columnSpacing(int column) const;
43    void setRowStretchFactor(int row, int stretch);
44    int rowStretchFactor(int row) const;
45    void setColumnStretchFactor(int column, int stretch);
46    int columnStretchFactor(int column) const;
47    void setRowMinimumHeight(int row, qreal height);
48    qreal rowMinimumHeight(int row) const;
49    void setRowPreferredHeight(int row, qreal height);
50    qreal rowPreferredHeight(int row) const;
51    void setRowMaximumHeight(int row, qreal height);
52    qreal rowMaximumHeight(int row) const;
53    void setRowFixedHeight(int row, qreal height);
54    void setColumnMinimumWidth(int column, qreal width);
55    qreal columnMinimumWidth(int column) const;
56    void setColumnPreferredWidth(int column, qreal width);
57    qreal columnPreferredWidth(int column) const;
58    void setColumnMaximumWidth(int column, qreal width);
59    qreal columnMaximumWidth(int column) const;
60    void setColumnFixedWidth(int column, qreal width);
61    void setRowAlignment(int row, Qt::Alignment alignment);
62    Qt::Alignment rowAlignment(int row) const;
63    void setColumnAlignment(int column, Qt::Alignment alignment);
64    Qt::Alignment columnAlignment(int column) const;
65    void setAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment);
66    Qt::Alignment alignment(QGraphicsLayoutItem *item) const;
67    int rowCount() const;
68    int columnCount() const;
69    QGraphicsLayoutItem *itemAt(int row, int column) const;
70    virtual int count() const;
71    virtual QGraphicsLayoutItem *itemAt(int index) const;
72    virtual void removeAt(int index);
73%MethodCode
74        // The ownership of any existing item must be passed back to Python.
75        QGraphicsLayoutItem *itm;
76
77        if (a0 < sipCpp->count())
78            itm = sipCpp->itemAt(a0);
79        else
80            itm = 0;
81
82        Py_BEGIN_ALLOW_THREADS
83        sipSelfWasArg ? sipCpp->QGraphicsGridLayout::removeAt(a0)
84                      : sipCpp->removeAt(a0);
85        Py_END_ALLOW_THREADS
86
87        if (itm)
88        {
89            PyObject *itmo = sipGetPyObject(itm, sipType_QGraphicsLayoutItem);
90
91            if (itmo)
92                sipTransferBack(itmo);
93        }
94%End
95
96    virtual void invalidate();
97    virtual void setGeometry(const QRectF &rect);
98    virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
99    void removeItem(QGraphicsLayoutItem *item /TransferBack/);
100};
101