KLayout 0.29.8 (2024-11-26 926dac96c) [master]

API reference - Class QSizePolicy

Notation used in Ruby API documentation

Module: QtWidgets

Description: Binding of QSizePolicy

Sub-classes: ControlType, QFlags_ControlType, Policy, QFlags_Policy

Public constructors

new QSizePolicynewConstructor QSizePolicy::QSizePolicy()
new QSizePolicynew(const QSizePolicy_Policy horizontal,
const QSizePolicy_Policy vertical,
const QSizePolicy_ControlType type = QSizePolicy::DefaultType)
Constructor QSizePolicy::QSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical, QSizePolicy::ControlType type)

Public methods

[const]bool!=(const QSizePolicy s)Method bool QSizePolicy::operator!=(const QSizePolicy &s)
[const]bool==(const QSizePolicy s)Method bool QSizePolicy::operator==(const QSizePolicy &s)
[const]QSizePolicy ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidassign(const QSizePolicy other)Assigns another object to self
[const]QSizePolicy_ControlTypecontrolTypeMethod QSizePolicy::ControlType QSizePolicy::controlType()
voidcontrolType=(const QSizePolicy_ControlType type)Method void QSizePolicy::setControlType(QSizePolicy::ControlType type)
[const]new QSizePolicy ptrdupCreates a copy of self
[const]Qt_QFlags_OrientationexpandingDirectionsMethod QFlags<Qt::Orientation> QSizePolicy::expandingDirections()
[const]boolhasHeightForWidthMethod bool QSizePolicy::hasHeightForWidth()
[const]boolhasWidthForHeightMethod bool QSizePolicy::hasWidthForHeight()
[const]boolheightForWidthMethod bool QSizePolicy::hasHeightForWidth()
voidheightForWidth=(bool b)Method void QSizePolicy::setHeightForWidth(bool b)
[const]QSizePolicy_PolicyhorizontalPolicyMethod QSizePolicy::Policy QSizePolicy::horizontalPolicy()
voidhorizontalPolicy=(const QSizePolicy_Policy d)Method void QSizePolicy::setHorizontalPolicy(QSizePolicy::Policy d)
[const]inthorizontalStretchMethod int QSizePolicy::horizontalStretch()
voidhorizontalStretch=(int stretchFactor)Method void QSizePolicy::setHorizontalStretch(int stretchFactor)
[const]boolretainSizeWhenHiddenMethod bool QSizePolicy::retainSizeWhenHidden()
voidretainSizeWhenHidden=(bool retainSize)Method void QSizePolicy::setRetainSizeWhenHidden(bool retainSize)
voidsetControlType(const QSizePolicy_ControlType type)Method void QSizePolicy::setControlType(QSizePolicy::ControlType type)
voidsetHeightForWidth(bool b)Method void QSizePolicy::setHeightForWidth(bool b)
voidsetHorizontalPolicy(const QSizePolicy_Policy d)Method void QSizePolicy::setHorizontalPolicy(QSizePolicy::Policy d)
voidsetHorizontalStretch(int stretchFactor)Method void QSizePolicy::setHorizontalStretch(int stretchFactor)
voidsetRetainSizeWhenHidden(bool retainSize)Method void QSizePolicy::setRetainSizeWhenHidden(bool retainSize)
voidsetVerticalPolicy(const QSizePolicy_Policy d)Method void QSizePolicy::setVerticalPolicy(QSizePolicy::Policy d)
voidsetVerticalStretch(int stretchFactor)Method void QSizePolicy::setVerticalStretch(int stretchFactor)
voidsetWidthForHeight(bool b)Method void QSizePolicy::setWidthForHeight(bool b)
voidtransposeMethod void QSizePolicy::transpose()
[const]QSizePolicytransposedMethod QSizePolicy QSizePolicy::transposed()
[const]QSizePolicy_PolicyverticalPolicyMethod QSizePolicy::Policy QSizePolicy::verticalPolicy()
voidverticalPolicy=(const QSizePolicy_Policy d)Method void QSizePolicy::setVerticalPolicy(QSizePolicy::Policy d)
[const]intverticalStretchMethod int QSizePolicy::verticalStretch()
voidverticalStretch=(int stretchFactor)Method void QSizePolicy::setVerticalStretch(int stretchFactor)
[const]boolwidthForHeightMethod bool QSizePolicy::hasWidthForHeight()
voidwidthForHeight=(bool b)Method void QSizePolicy::setWidthForHeight(bool b)

Public static methods and constants

[static,const]QSizePolicy_ControlTypeButtonBoxEnum constant QSizePolicy::ButtonBox
[static,const]QSizePolicy_ControlTypeCheckBoxEnum constant QSizePolicy::CheckBox
[static,const]QSizePolicy_ControlTypeComboBoxEnum constant QSizePolicy::ComboBox
[static,const]QSizePolicy_ControlTypeDefaultTypeEnum constant QSizePolicy::DefaultType
[static,const]QSizePolicy_PolicyExpandingEnum constant QSizePolicy::Expanding
[static,const]QSizePolicy_PolicyFixedEnum constant QSizePolicy::Fixed
[static,const]QSizePolicy_ControlTypeFrameEnum constant QSizePolicy::Frame
[static,const]QSizePolicy_ControlTypeGroupBoxEnum constant QSizePolicy::GroupBox
[static,const]QSizePolicy_PolicyIgnoredEnum constant QSizePolicy::Ignored
[static,const]QSizePolicy_ControlTypeLabelEnum constant QSizePolicy::Label
[static,const]QSizePolicy_ControlTypeLineEnum constant QSizePolicy::Line
[static,const]QSizePolicy_ControlTypeLineEditEnum constant QSizePolicy::LineEdit
[static,const]QSizePolicy_PolicyMaximumEnum constant QSizePolicy::Maximum
[static,const]QSizePolicy_PolicyMinimumEnum constant QSizePolicy::Minimum
[static,const]QSizePolicy_PolicyMinimumExpandingEnum constant QSizePolicy::MinimumExpanding
[static,const]QSizePolicy_PolicyPreferredEnum constant QSizePolicy::Preferred
[static,const]QSizePolicy_ControlTypePushButtonEnum constant QSizePolicy::PushButton
[static,const]QSizePolicy_ControlTypeRadioButtonEnum constant QSizePolicy::RadioButton
[static,const]QSizePolicy_ControlTypeSliderEnum constant QSizePolicy::Slider
[static,const]QSizePolicy_ControlTypeSpinBoxEnum constant QSizePolicy::SpinBox
[static,const]QSizePolicy_ControlTypeTabWidgetEnum constant QSizePolicy::TabWidget
[static,const]QSizePolicy_ControlTypeToolButtonEnum constant QSizePolicy::ToolButton

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

!=

Signature: [const] bool != (const QSizePolicy s)

Description: Method bool QSizePolicy::operator!=(const QSizePolicy &s)

==

Signature: [const] bool == (const QSizePolicy s)

Description: Method bool QSizePolicy::operator==(const QSizePolicy &s)

ButtonBox

Signature: [static,const] QSizePolicy_ControlType ButtonBox

Description: Enum constant QSizePolicy::ButtonBox

Python specific notes:
The object exposes a readable attribute 'ButtonBox'. This is the getter.

CheckBox

Signature: [static,const] QSizePolicy_ControlType CheckBox

Description: Enum constant QSizePolicy::CheckBox

Python specific notes:
The object exposes a readable attribute 'CheckBox'. This is the getter.

ComboBox

Signature: [static,const] QSizePolicy_ControlType ComboBox

Description: Enum constant QSizePolicy::ComboBox

Python specific notes:
The object exposes a readable attribute 'ComboBox'. This is the getter.

DefaultType

Signature: [static,const] QSizePolicy_ControlType DefaultType

Description: Enum constant QSizePolicy::DefaultType

Python specific notes:
The object exposes a readable attribute 'DefaultType'. This is the getter.

Expanding

Signature: [static,const] QSizePolicy_Policy Expanding

Description: Enum constant QSizePolicy::Expanding

Python specific notes:
The object exposes a readable attribute 'Expanding'. This is the getter.

Fixed

Signature: [static,const] QSizePolicy_Policy Fixed

Description: Enum constant QSizePolicy::Fixed

Python specific notes:
The object exposes a readable attribute 'Fixed'. This is the getter.

Frame

Signature: [static,const] QSizePolicy_ControlType Frame

Description: Enum constant QSizePolicy::Frame

Python specific notes:
The object exposes a readable attribute 'Frame'. This is the getter.

GroupBox

Signature: [static,const] QSizePolicy_ControlType GroupBox

Description: Enum constant QSizePolicy::GroupBox

Python specific notes:
The object exposes a readable attribute 'GroupBox'. This is the getter.

Ignored

Signature: [static,const] QSizePolicy_Policy Ignored

Description: Enum constant QSizePolicy::Ignored

Python specific notes:
The object exposes a readable attribute 'Ignored'. This is the getter.

Label

Signature: [static,const] QSizePolicy_ControlType Label

Description: Enum constant QSizePolicy::Label

Python specific notes:
The object exposes a readable attribute 'Label'. This is the getter.

Line

Signature: [static,const] QSizePolicy_ControlType Line

Description: Enum constant QSizePolicy::Line

Python specific notes:
The object exposes a readable attribute 'Line'. This is the getter.

LineEdit

Signature: [static,const] QSizePolicy_ControlType LineEdit

Description: Enum constant QSizePolicy::LineEdit

Python specific notes:
The object exposes a readable attribute 'LineEdit'. This is the getter.

Maximum

Signature: [static,const] QSizePolicy_Policy Maximum

Description: Enum constant QSizePolicy::Maximum

Python specific notes:
The object exposes a readable attribute 'Maximum'. This is the getter.

Minimum

Signature: [static,const] QSizePolicy_Policy Minimum

Description: Enum constant QSizePolicy::Minimum

Python specific notes:
The object exposes a readable attribute 'Minimum'. This is the getter.

MinimumExpanding

Signature: [static,const] QSizePolicy_Policy MinimumExpanding

Description: Enum constant QSizePolicy::MinimumExpanding

Python specific notes:
The object exposes a readable attribute 'MinimumExpanding'. This is the getter.

Preferred

Signature: [static,const] QSizePolicy_Policy Preferred

Description: Enum constant QSizePolicy::Preferred

Python specific notes:
The object exposes a readable attribute 'Preferred'. This is the getter.

PushButton

Signature: [static,const] QSizePolicy_ControlType PushButton

Description: Enum constant QSizePolicy::PushButton

Python specific notes:
The object exposes a readable attribute 'PushButton'. This is the getter.

RadioButton

Signature: [static,const] QSizePolicy_ControlType RadioButton

Description: Enum constant QSizePolicy::RadioButton

Python specific notes:
The object exposes a readable attribute 'RadioButton'. This is the getter.

Slider

Signature: [static,const] QSizePolicy_ControlType Slider

Description: Enum constant QSizePolicy::Slider

Python specific notes:
The object exposes a readable attribute 'Slider'. This is the getter.

SpinBox

Signature: [static,const] QSizePolicy_ControlType SpinBox

Description: Enum constant QSizePolicy::SpinBox

Python specific notes:
The object exposes a readable attribute 'SpinBox'. This is the getter.

TabWidget

Signature: [static,const] QSizePolicy_ControlType TabWidget

Description: Enum constant QSizePolicy::TabWidget

Python specific notes:
The object exposes a readable attribute 'TabWidget'. This is the getter.

ToolButton

Signature: [static,const] QSizePolicy_ControlType ToolButton

Description: Enum constant QSizePolicy::ToolButton

Python specific notes:
The object exposes a readable attribute 'ToolButton'. This is the getter.

_const_cast

Signature: [const] QSizePolicy ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

assign

Signature: void assign (const QSizePolicy other)

Description: Assigns another object to self

controlType

Signature: [const] QSizePolicy_ControlType controlType

Description: Method QSizePolicy::ControlType QSizePolicy::controlType()

Python specific notes:
The object exposes a readable attribute 'controlType'. This is the getter.

controlType=

Signature: void controlType= (const QSizePolicy_ControlType type)

Description: Method void QSizePolicy::setControlType(QSizePolicy::ControlType type)

Python specific notes:
The object exposes a writable attribute 'controlType'. This is the setter.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup

Signature: [const] new QSizePolicy ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

expandingDirections

Signature: [const] Qt_QFlags_Orientation expandingDirections

Description: Method QFlags<Qt::Orientation> QSizePolicy::expandingDirections()

hasHeightForWidth

Signature: [const] bool hasHeightForWidth

Description: Method bool QSizePolicy::hasHeightForWidth()

Python specific notes:
The object exposes a readable attribute 'heightForWidth'. This is the getter.

hasWidthForHeight

Signature: [const] bool hasWidthForHeight

Description: Method bool QSizePolicy::hasWidthForHeight()

Python specific notes:
The object exposes a readable attribute 'widthForHeight'. This is the getter.

heightForWidth

Signature: [const] bool heightForWidth

Description: Method bool QSizePolicy::hasHeightForWidth()

Python specific notes:
The object exposes a readable attribute 'heightForWidth'. This is the getter.

heightForWidth=

Signature: void heightForWidth= (bool b)

Description: Method void QSizePolicy::setHeightForWidth(bool b)

Python specific notes:
The object exposes a writable attribute 'heightForWidth'. This is the setter.

horizontalPolicy

Signature: [const] QSizePolicy_Policy horizontalPolicy

Description: Method QSizePolicy::Policy QSizePolicy::horizontalPolicy()

Python specific notes:
The object exposes a readable attribute 'horizontalPolicy'. This is the getter.

horizontalPolicy=

Signature: void horizontalPolicy= (const QSizePolicy_Policy d)

Description: Method void QSizePolicy::setHorizontalPolicy(QSizePolicy::Policy d)

Python specific notes:
The object exposes a writable attribute 'horizontalPolicy'. This is the setter.

horizontalStretch

Signature: [const] int horizontalStretch

Description: Method int QSizePolicy::horizontalStretch()

Python specific notes:
The object exposes a readable attribute 'horizontalStretch'. This is the getter.

horizontalStretch=

Signature: void horizontalStretch= (int stretchFactor)

Description: Method void QSizePolicy::setHorizontalStretch(int stretchFactor)

Python specific notes:
The object exposes a writable attribute 'horizontalStretch'. This is the setter.

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

new

(1) Signature: [static] new QSizePolicy new

Description: Constructor QSizePolicy::QSizePolicy()

This method creates an object of class QSizePolicy.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QSizePolicy new (const QSizePolicy_Policy horizontal, const QSizePolicy_Policy vertical, const QSizePolicy_ControlType type = QSizePolicy::DefaultType)

Description: Constructor QSizePolicy::QSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical, QSizePolicy::ControlType type)

This method creates an object of class QSizePolicy.

Python specific notes:
This method is the default initializer of the object.

retainSizeWhenHidden

Signature: [const] bool retainSizeWhenHidden

Description: Method bool QSizePolicy::retainSizeWhenHidden()

Python specific notes:
The object exposes a readable attribute 'retainSizeWhenHidden'. This is the getter.

retainSizeWhenHidden=

Signature: void retainSizeWhenHidden= (bool retainSize)

Description: Method void QSizePolicy::setRetainSizeWhenHidden(bool retainSize)

Python specific notes:
The object exposes a writable attribute 'retainSizeWhenHidden'. This is the setter.

setControlType

Signature: void setControlType (const QSizePolicy_ControlType type)

Description: Method void QSizePolicy::setControlType(QSizePolicy::ControlType type)

Python specific notes:
The object exposes a writable attribute 'controlType'. This is the setter.

setHeightForWidth

Signature: void setHeightForWidth (bool b)

Description: Method void QSizePolicy::setHeightForWidth(bool b)

Python specific notes:
The object exposes a writable attribute 'heightForWidth'. This is the setter.

setHorizontalPolicy

Signature: void setHorizontalPolicy (const QSizePolicy_Policy d)

Description: Method void QSizePolicy::setHorizontalPolicy(QSizePolicy::Policy d)

Python specific notes:
The object exposes a writable attribute 'horizontalPolicy'. This is the setter.

setHorizontalStretch

Signature: void setHorizontalStretch (int stretchFactor)

Description: Method void QSizePolicy::setHorizontalStretch(int stretchFactor)

Python specific notes:
The object exposes a writable attribute 'horizontalStretch'. This is the setter.

setRetainSizeWhenHidden

Signature: void setRetainSizeWhenHidden (bool retainSize)

Description: Method void QSizePolicy::setRetainSizeWhenHidden(bool retainSize)

Python specific notes:
The object exposes a writable attribute 'retainSizeWhenHidden'. This is the setter.

setVerticalPolicy

Signature: void setVerticalPolicy (const QSizePolicy_Policy d)

Description: Method void QSizePolicy::setVerticalPolicy(QSizePolicy::Policy d)

Python specific notes:
The object exposes a writable attribute 'verticalPolicy'. This is the setter.

setVerticalStretch

Signature: void setVerticalStretch (int stretchFactor)

Description: Method void QSizePolicy::setVerticalStretch(int stretchFactor)

Python specific notes:
The object exposes a writable attribute 'verticalStretch'. This is the setter.

setWidthForHeight

Signature: void setWidthForHeight (bool b)

Description: Method void QSizePolicy::setWidthForHeight(bool b)

Python specific notes:
The object exposes a writable attribute 'widthForHeight'. This is the setter.

transpose

Signature: void transpose

Description: Method void QSizePolicy::transpose()

transposed

Signature: [const] QSizePolicy transposed

Description: Method QSizePolicy QSizePolicy::transposed()

verticalPolicy

Signature: [const] QSizePolicy_Policy verticalPolicy

Description: Method QSizePolicy::Policy QSizePolicy::verticalPolicy()

Python specific notes:
The object exposes a readable attribute 'verticalPolicy'. This is the getter.

verticalPolicy=

Signature: void verticalPolicy= (const QSizePolicy_Policy d)

Description: Method void QSizePolicy::setVerticalPolicy(QSizePolicy::Policy d)

Python specific notes:
The object exposes a writable attribute 'verticalPolicy'. This is the setter.

verticalStretch

Signature: [const] int verticalStretch

Description: Method int QSizePolicy::verticalStretch()

Python specific notes:
The object exposes a readable attribute 'verticalStretch'. This is the getter.

verticalStretch=

Signature: void verticalStretch= (int stretchFactor)

Description: Method void QSizePolicy::setVerticalStretch(int stretchFactor)

Python specific notes:
The object exposes a writable attribute 'verticalStretch'. This is the setter.

widthForHeight

Signature: [const] bool widthForHeight

Description: Method bool QSizePolicy::hasWidthForHeight()

Python specific notes:
The object exposes a readable attribute 'widthForHeight'. This is the getter.

widthForHeight=

Signature: void widthForHeight= (bool b)

Description: Method void QSizePolicy::setWidthForHeight(bool b)

Python specific notes:
The object exposes a writable attribute 'widthForHeight'. This is the setter.