qformlayout.sip 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // qformlayout.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 QFormLayout : public QLayout
  22. {
  23. %TypeHeaderCode
  24. #include <qformlayout.h>
  25. %End
  26. public:
  27. enum FieldGrowthPolicy
  28. {
  29. FieldsStayAtSizeHint,
  30. ExpandingFieldsGrow,
  31. AllNonFixedFieldsGrow,
  32. };
  33. enum RowWrapPolicy
  34. {
  35. DontWrapRows,
  36. WrapLongRows,
  37. WrapAllRows,
  38. };
  39. enum ItemRole
  40. {
  41. LabelRole,
  42. FieldRole,
  43. SpanningRole,
  44. };
  45. explicit QFormLayout(QWidget *parent /TransferThis/ = 0);
  46. virtual ~QFormLayout();
  47. void setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy);
  48. QFormLayout::FieldGrowthPolicy fieldGrowthPolicy() const;
  49. void setRowWrapPolicy(QFormLayout::RowWrapPolicy policy);
  50. QFormLayout::RowWrapPolicy rowWrapPolicy() const;
  51. void setLabelAlignment(Qt::Alignment alignment);
  52. Qt::Alignment labelAlignment() const;
  53. void setFormAlignment(Qt::Alignment alignment);
  54. Qt::Alignment formAlignment() const;
  55. void setHorizontalSpacing(int spacing);
  56. int horizontalSpacing() const;
  57. void setVerticalSpacing(int spacing);
  58. int verticalSpacing() const;
  59. virtual int spacing() const;
  60. virtual void setSpacing(int);
  61. void addRow(QWidget *label /Transfer/, QWidget *field /Transfer/);
  62. void addRow(QWidget *label /Transfer/, QLayout *field /Transfer/);
  63. void addRow(const QString &labelText, QWidget *field /Transfer/);
  64. void addRow(const QString &labelText, QLayout *field /Transfer/);
  65. void addRow(QWidget *widget /Transfer/);
  66. void addRow(QLayout *layout /Transfer/);
  67. void insertRow(int row, QWidget *label /Transfer/, QWidget *field /Transfer/);
  68. void insertRow(int row, QWidget *label /Transfer/, QLayout *field /Transfer/);
  69. void insertRow(int row, const QString &labelText, QWidget *field /Transfer/);
  70. void insertRow(int row, const QString &labelText, QLayout *field /Transfer/);
  71. void insertRow(int row, QWidget *widget /Transfer/);
  72. void insertRow(int row, QLayout *layout /Transfer/);
  73. void setItem(int row, QFormLayout::ItemRole role, QLayoutItem *item /Transfer/);
  74. void setWidget(int row, QFormLayout::ItemRole role, QWidget *widget /Transfer/);
  75. void setLayout(int row, QFormLayout::ItemRole role, QLayout *layout /Transfer/);
  76. QLayoutItem *itemAt(int row, QFormLayout::ItemRole role) const;
  77. void getItemPosition(int index, int *rowPtr, QFormLayout::ItemRole *rolePtr) const;
  78. void getWidgetPosition(QWidget *widget, int *rowPtr, QFormLayout::ItemRole *rolePtr) const;
  79. void getLayoutPosition(QLayout *layout, int *rowPtr, QFormLayout::ItemRole *rolePtr) const;
  80. QWidget *labelForField(QWidget *field) const;
  81. QWidget *labelForField(QLayout *field) const;
  82. virtual void addItem(QLayoutItem *item /Transfer/);
  83. virtual QLayoutItem *itemAt(int index) const;
  84. virtual QLayoutItem *takeAt(int index) /TransferBack/;
  85. virtual void setGeometry(const QRect &rect);
  86. virtual QSize minimumSize() const;
  87. virtual QSize sizeHint() const;
  88. virtual void invalidate();
  89. virtual bool hasHeightForWidth() const;
  90. virtual int heightForWidth(int width) const;
  91. virtual Qt::Orientations expandingDirections() const;
  92. virtual int count() const;
  93. int rowCount() const;
  94. struct TakeRowResult
  95. {
  96. %TypeHeaderCode
  97. #include <qformlayout.h>
  98. %End
  99. QLayoutItem *labelItem;
  100. QLayoutItem *fieldItem;
  101. };
  102. void removeRow(int row);
  103. void removeRow(QWidget *widget);
  104. void removeRow(QLayout *layout);
  105. QFormLayout::TakeRowResult takeRow(int row);
  106. QFormLayout::TakeRowResult takeRow(QWidget *widget);
  107. QFormLayout::TakeRowResult takeRow(QLayout *layout);
  108. %If (Qt_6_4_0 -)
  109. void setRowVisible(QLayout *layout, bool on);
  110. %End
  111. %If (Qt_6_4_0 -)
  112. void setRowVisible(QWidget *widget, bool on);
  113. %End
  114. %If (Qt_6_4_0 -)
  115. void setRowVisible(int row, bool on);
  116. %End
  117. %If (Qt_6_4_0 -)
  118. bool isRowVisible(QLayout *layout) const;
  119. %End
  120. %If (Qt_6_4_0 -)
  121. bool isRowVisible(QWidget *widget) const;
  122. %End
  123. %If (Qt_6_4_0 -)
  124. bool isRowVisible(int row) const;
  125. %End
  126. };