1// qgridlayout.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 QGridLayout : QLayout 24{ 25%TypeHeaderCode 26#include <qgridlayout.h> 27%End 28 29public: 30 explicit QGridLayout(QWidget *parent /TransferThis/); 31 QGridLayout(); 32 virtual ~QGridLayout(); 33 virtual QSize sizeHint() const; 34 virtual QSize minimumSize() const; 35 virtual QSize maximumSize() const; 36 void setRowStretch(int row, int stretch); 37 void setColumnStretch(int column, int stretch); 38 int rowStretch(int row) const; 39 int columnStretch(int column) const; 40 void setRowMinimumHeight(int row, int minSize); 41 void setColumnMinimumWidth(int column, int minSize); 42 int rowMinimumHeight(int row) const; 43 int columnMinimumWidth(int column) const; 44 int columnCount() const; 45 int rowCount() const; 46 QRect cellRect(int row, int column) const; 47 virtual bool hasHeightForWidth() const; 48 virtual int heightForWidth(int) const; 49 virtual int minimumHeightForWidth(int) const; 50 virtual Qt::Orientations expandingDirections() const; 51 virtual void invalidate(); 52 void addWidget(QWidget *w /GetWrapper/); 53%MethodCode 54 Py_BEGIN_ALLOW_THREADS 55 sipCpp->addWidget(a0); 56 Py_END_ALLOW_THREADS 57 58 // The layout's parent widget (if there is one) will now have ownership. 59 QWidget *parent = sipCpp->parentWidget(); 60 61 if (parent) 62 { 63 PyObject *py_parent = sipGetPyObject(parent, sipType_QWidget); 64 65 if (py_parent) 66 sipTransferTo(a0Wrapper, py_parent); 67 } 68 else 69 { 70 // For now give the Python ownership to the layout. This maintains 71 // compatibility with previous versions and allows addWidget(QWidget()). 72 sipTransferTo(a0Wrapper, sipSelf); 73 } 74%End 75 76 void addWidget(QWidget * /GetWrapper/, int row, int column, Qt::Alignment alignment = Qt::Alignment()); 77%MethodCode 78 Py_BEGIN_ALLOW_THREADS 79 sipCpp->addWidget(a0, a1, a2, *a3); 80 Py_END_ALLOW_THREADS 81 82 // The layout's parent widget (if there is one) will now have ownership. 83 QWidget *parent = sipCpp->parentWidget(); 84 85 if (parent) 86 { 87 PyObject *py_parent = sipGetPyObject(parent, sipType_QWidget); 88 89 if (py_parent) 90 sipTransferTo(a0Wrapper, py_parent); 91 } 92 else 93 { 94 // For now give the Python ownership to the layout. This maintains 95 // compatibility with previous versions and allows addWidget(QWidget()). 96 sipTransferTo(a0Wrapper, sipSelf); 97 } 98%End 99 100 void addWidget(QWidget * /GetWrapper/, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = Qt::Alignment()); 101%MethodCode 102 Py_BEGIN_ALLOW_THREADS 103 sipCpp->addWidget(a0, a1, a2, a3, a4, *a5); 104 Py_END_ALLOW_THREADS 105 106 // The layout's parent widget (if there is one) will now have ownership. 107 QWidget *parent = sipCpp->parentWidget(); 108 109 if (parent) 110 { 111 PyObject *py_parent = sipGetPyObject(parent, sipType_QWidget); 112 113 if (py_parent) 114 sipTransferTo(a0Wrapper, py_parent); 115 } 116 else 117 { 118 // For now give the Python ownership to the layout. This maintains 119 // compatibility with previous versions and allows addWidget(QWidget()). 120 sipTransferTo(a0Wrapper, sipSelf); 121 } 122%End 123 124 void addLayout(QLayout * /Transfer/, int row, int column, Qt::Alignment alignment = Qt::Alignment()); 125 void addLayout(QLayout * /Transfer/, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = Qt::Alignment()); 126 void setOriginCorner(Qt::Corner); 127 Qt::Corner originCorner() const; 128 virtual QLayoutItem *itemAt(int) const; 129 virtual QLayoutItem *takeAt(int) /TransferBack/; 130 virtual int count() const; 131 virtual void setGeometry(const QRect &); 132 void addItem(QLayoutItem *item /Transfer/, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = Qt::Alignment()); 133 void setDefaultPositioning(int n, Qt::Orientation orient); 134 void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan) const; 135 void setHorizontalSpacing(int spacing); 136 int horizontalSpacing() const; 137 void setVerticalSpacing(int spacing); 138 int verticalSpacing() const; 139 void setSpacing(int spacing); 140 int spacing() const; 141 QLayoutItem *itemAtPosition(int row, int column) const; 142 143protected: 144 virtual void addItem(QLayoutItem * /Transfer/); 145}; 146