qsizepolicy.sip 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // qsizepolicy.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 QSizePolicy
  22. {
  23. %TypeHeaderCode
  24. #include <qsizepolicy.h>
  25. %End
  26. public:
  27. enum PolicyFlag /BaseType=IntFlag/
  28. {
  29. GrowFlag,
  30. ExpandFlag,
  31. ShrinkFlag,
  32. IgnoreFlag,
  33. };
  34. enum Policy
  35. {
  36. Fixed,
  37. Minimum,
  38. Maximum,
  39. Preferred,
  40. MinimumExpanding,
  41. Expanding,
  42. Ignored,
  43. };
  44. QSizePolicy();
  45. QSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical, QSizePolicy::ControlType type = QSizePolicy::DefaultType);
  46. QSizePolicy(const QVariant &variant /GetWrapper/) /NoDerived/;
  47. %MethodCode
  48. if (a0->canConvert<QSizePolicy>())
  49. sipCpp = new QSizePolicy(a0->value<QSizePolicy>());
  50. else
  51. sipError = sipBadCallableArg(0, a0Wrapper);
  52. %End
  53. QSizePolicy::Policy horizontalPolicy() const;
  54. QSizePolicy::Policy verticalPolicy() const;
  55. void setHorizontalPolicy(QSizePolicy::Policy d);
  56. void setVerticalPolicy(QSizePolicy::Policy d);
  57. Qt::Orientations expandingDirections() const;
  58. void setHeightForWidth(bool b);
  59. bool hasHeightForWidth() const;
  60. bool operator==(const QSizePolicy &s) const;
  61. bool operator!=(const QSizePolicy &s) const;
  62. int horizontalStretch() const;
  63. int verticalStretch() const;
  64. void setHorizontalStretch(int stretchFactor);
  65. void setVerticalStretch(int stretchFactor);
  66. void transpose();
  67. QSizePolicy transposed() const;
  68. enum ControlType /BaseType=Flag/
  69. {
  70. DefaultType,
  71. ButtonBox,
  72. CheckBox,
  73. ComboBox,
  74. Frame,
  75. GroupBox,
  76. Label,
  77. Line,
  78. LineEdit,
  79. PushButton,
  80. RadioButton,
  81. Slider,
  82. SpinBox,
  83. TabWidget,
  84. ToolButton,
  85. };
  86. typedef QFlags<QSizePolicy::ControlType> ControlTypes;
  87. QSizePolicy::ControlType controlType() const;
  88. void setControlType(QSizePolicy::ControlType type);
  89. void setWidthForHeight(bool b);
  90. bool hasWidthForHeight() const;
  91. bool retainSizeWhenHidden() const;
  92. void setRetainSizeWhenHidden(bool retainSize);
  93. Py_hash_t __hash__() const;
  94. %MethodCode
  95. sipRes = qHash(*sipCpp);
  96. %End
  97. };
  98. QDataStream &operator<<(QDataStream &, const QSizePolicy &) /ReleaseGIL/;
  99. QDataStream &operator>>(QDataStream &, QSizePolicy & /Constrained/) /ReleaseGIL/;