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