qgridlayout.sip 5.4 KB

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