Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QSizePolicy Class Reference

The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy. More...

Inheritance diagram for QtGui.QSizePolicy:
Collaboration diagram for QtGui.QSizePolicy:

Public Types

enum  ControlType {
  ButtonBox = 2, CheckBox = 4, ComboBox = 8, DefaultType = 1,
  Frame = 16, GroupBox = 32, Label = 64, Line = 128,
  LineEdit = 256, PushButton = 512, RadioButton = 1024, Slider = 2048,
  SpinBox = 4096, TabWidget = 8192, ToolButton = 16384
}
  More...
 
enum  Policy {
  Expanding = 7, Fixed = 0, Ignored = 13, Maximum = 4,
  Minimum = 1, MinimumExpanding = 3, Preferred = 5
}
  More...
 
enum  PolicyFlag { ExpandFlag = 2, GrowFlag = 1, IgnoreFlag = 8, ShrinkFlag = 4 }
  More...
 
enum  SizePolicyMasks
 

Public Member Functions

override bool Equals (object o)
 
override int GetHashCode ()
 
 QSizePolicy ()
 
 
 QSizePolicy (QSizePolicy copy)
 
 
 QSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical)
 
 
 QSizePolicy (QSizePolicy.Policy horizontal, QSizePolicy.Policy vertical, QSizePolicy.ControlType type)
 
 
virtual void CreateProxy ()
 
new Qt.Orientation ExpandingDirections ()
 
 
new bool HasHeightForWidth ()
 
 
new bool HasWidthForHeight ()
 
 
new int HorizontalStretch ()
 
 
new void SetHeightForWidth (bool b)
 
 
new void SetHorizontalStretch (byte stretchFactor)
 
 
new void SetVerticalStretch (byte stretchFactor)
 
 
new void SetWidthForHeight (bool b)
 
 
new void Transpose ()
 
 
new int VerticalStretch ()
 
 
new void Dispose ()
 

Static Public Member Functions

static bool operator!= (QSizePolicy arg1, QSizePolicy arg2)
 
 
static bool operator== (QSizePolicy arg1, QSizePolicy arg2)
 
 

Protected Member Functions

 QSizePolicy (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QSizePolicy.ControlType controlType [get, set]
 
 
new QSizePolicy.Policy HorizontalPolicy [get, set]
 
 
new QSizePolicy.Policy VerticalPolicy [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
static new QMetaObject StaticMetaObject [get]
 

Detailed Description

The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.

The size policy of a widget is an expression of its willingness to be resized in various ways, and affects how the widget is treated by the layout engine. Each widget returns a QSizePolicy that describes the horizontal and vertical resizing policy it prefers when being laid out. You can change this for a specific widget by changing its QWidget::sizePolicy property.

QSizePolicy contains two independent QSizePolicy::Policy values and two stretch factors; one describes the widgets's horizontal size policy, and the other describes its vertical size policy. It also contains a flag to indicate whether the height and width of its preferred size are related.

The horizontal and vertical policies can be set in the constructor, and altered using the setHorizontalPolicy() and setVerticalPolicy() functions. The stretch factors can be set using the setHorizontalStretch() and setVerticalStretch() functions. The flag indicating whether the widget's sizeHint() is width-dependent (such as a menu bar or a word-wrapping label) can be set using the setHeightForWidth() function.

The current size policies and stretch factors be retrieved using the horizontalPolicy(), verticalPolicy(), horizontalStretch() and verticalStretch() functions. Alternatively, use the transpose() function to swap the horizontal and vertical policies and stretches. The hasHeightForWidth() function returns the current status of the flag indicating the size hint dependencies.

Use the expandingDirections() function to determine whether the associated widget can make use of more space than its sizeHint() function indicates, as well as find out in which directions it can expand.

Finally, the QSizePolicy class provides operators comparing this size policy to a given policy, as well as a QVariant operator storing this QSizePolicy as a QVariant object.

See also QSize, QWidget::sizeHint(), QWidget::sizePolicy, and QLayoutItem::sizeHint().

Member Enumeration Documentation

This enum specifies the different types of widgets in terms of layout interaction:

This enum was introduced or modified in Qt 4.3.

See also setControlType() and controlType().

Enumerator:
ButtonBox 

A QDialogButtonBox instance.

CheckBox 

A QCheckBox instance.

ComboBox 

A QComboBox instance.

DefaultType 

The default type, when none is specified.

Frame 

A QFrame instance.

GroupBox 

A QGroupBox instance.

Label 

A QLabel instance.

Line 

A QFrame instance with QFrame::HLine or QFrame::VLine.

LineEdit 

A QLineEdit instance.

PushButton 

A QPushButton instance.

RadioButton 

A QRadioButton instance.

Slider 

A QAbstractSlider instance.

SpinBox 

A QAbstractSpinBox instance.

TabWidget 

A QTabWidget instance.

ToolButton 

A QToolButton instance.

This enum describes the various per-dimension sizing types used when constructing a QSizePolicy.

See also PolicyFlag, setHorizontalPolicy(), and setVerticalPolicy().

Enumerator:
Expanding 

The sizeHint() is a sensible size, but the widget can be shrunk and still be useful. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a horizontal slider).

Fixed 

The QWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button).

Ignored 

The sizeHint() is ignored. The widget will get as much space as possible.

Maximum 

The sizeHint() is a maximum. The widget can be shrunk any amount without detriment if other widgets need the space (e.g. a separator line). It cannot be larger than the size provided by sizeHint().

Minimum 

The sizeHint() is minimal, and sufficient. The widget can be expanded, but there is no advantage to it being larger (e.g. the horizontal direction of a push button). It cannot be smaller than the size provided by sizeHint().

MinimumExpanding 

The sizeHint() is minimal, and sufficient. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a horizontal slider).

Preferred 

The sizeHint() is best, but the widget can be shrunk and still be useful. The widget can be expanded, but there is no advantage to it being larger than sizeHint() (the default QWidget policy).

These flags are combined together to form the various Policy values:

See also Policy.

Enumerator:
ExpandFlag 

The widget should get as much space as possible.

GrowFlag 

The widget can grow beyond its size hint if necessary.

IgnoreFlag 

The widget's size hint is ignored. The widget will get as much space as possible.

ShrinkFlag 

The widget can shrink below its size hint if necessary.

Constructor & Destructor Documentation

QtGui.QSizePolicy.QSizePolicy ( System.Type  dummy)
protected
QtGui.QSizePolicy.QSizePolicy ( )

Constructs a QSizePolicy object with Fixed as its horizontal and vertical policies.

The policies can be altered using the setHorizontalPolicy() and setVerticalPolicy() functions. Use the setHeightForWidth() function if the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with line wrapping).

See also setHorizontalStretch() and setVerticalStretch().

QtGui.QSizePolicy.QSizePolicy ( QSizePolicy  copy)

Constructs a QSizePolicy object with Fixed as its horizontal and vertical policies.

The policies can be altered using the setHorizontalPolicy() and setVerticalPolicy() functions. Use the setHeightForWidth() function if the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with line wrapping).

See also setHorizontalStretch() and setVerticalStretch().

QtGui.QSizePolicy.QSizePolicy ( QSizePolicy.Policy  horizontal,
QSizePolicy.Policy  vertical 
)

Constructs a QSizePolicy object with the given horizontal and vertical policies, and DefaultType as the control type.

Use setHeightForWidth() if the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with line wrapping).

See also setHorizontalStretch() and setVerticalStretch().

QtGui.QSizePolicy.QSizePolicy ( QSizePolicy.Policy  horizontal,
QSizePolicy.Policy  vertical,
QSizePolicy.ControlType  type 
)

Constructs a QSizePolicy object with the given horizontal and vertical policies, and the specified control type.

Use setHeightForWidth() if the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with line wrapping).

This function was introduced in Qt 4.3.

See also setHorizontalStretch(), setVerticalStretch(), and controlType().

Member Function Documentation

virtual void QtGui.QSizePolicy.CreateProxy ( )
virtual
new void QtGui.QSizePolicy.Dispose ( )
override bool QtGui.QSizePolicy.Equals ( object  o)
new Qt.Orientation QtGui.QSizePolicy.ExpandingDirections ( )

Returns whether a widget can make use of more space than the QWidget::sizeHint() function indicates.

A value of Qt::Horizontal or Qt::Vertical means that the widget can grow horizontally or vertically (i.e., the horizontal or vertical policy is Expanding or MinimumExpanding), whereas Qt::Horizontal | Qt::Vertical means that it can grow in both dimensions.

See also horizontalPolicy() and verticalPolicy().

override int QtGui.QSizePolicy.GetHashCode ( )
new bool QtGui.QSizePolicy.HasHeightForWidth ( )

Returns true if the widget's preferred height depends on its width; otherwise returns false.

See also setHeightForWidth().

new bool QtGui.QSizePolicy.HasWidthForHeight ( )

Returns true if the widget's width depends on its height; otherwise returns false.

This function was introduced in Qt 4.8.

See also setWidthForHeight().

new int QtGui.QSizePolicy.HorizontalStretch ( )

Returns the horizontal stretch factor of the size policy.

See also setHorizontalStretch(), verticalStretch(), and horizontalPolicy().

static bool QtGui.QSizePolicy.operator!= ( QSizePolicy  arg1,
QSizePolicy  arg2 
)
static

Returns true if this policy is different from other; otherwise returns false.

See also operator==().

static bool QtGui.QSizePolicy.operator== ( QSizePolicy  arg1,
QSizePolicy  arg2 
)
static

Returns true if this policy is equal to other; otherwise returns false.

See also operator!=().

new void QtGui.QSizePolicy.SetHeightForWidth ( bool  b)

Sets the flag determining whether the widget's preferred height depends on its width, to dependent.

See also hasHeightForWidth() and setWidthForHeight().

new void QtGui.QSizePolicy.SetHorizontalStretch ( byte  stretchFactor)

Sets the horizontal stretch factor of the size policy to the given stretchFactor.

See also horizontalStretch(), setVerticalStretch(), and setHorizontalPolicy().

new void QtGui.QSizePolicy.SetVerticalStretch ( byte  stretchFactor)

Sets the vertical stretch factor of the size policy to the given stretchFactor.

See also verticalStretch(), setHorizontalStretch(), and setVerticalPolicy().

new void QtGui.QSizePolicy.SetWidthForHeight ( bool  b)

Sets the flag determining whether the widget's width depends on its height, to dependent.

This is only supported for QGraphicsLayout's subclasses. It is not possible to have a layout with both height-for-width and width-for-height constraints at the same time.

This function was introduced in Qt 4.8.

See also hasWidthForHeight() and setHeightForWidth().

new void QtGui.QSizePolicy.Transpose ( )

Swaps the horizontal and vertical policies and stretches.

new int QtGui.QSizePolicy.VerticalStretch ( )

Returns the vertical stretch factor of the size policy.

See also setVerticalStretch(), horizontalStretch(), and verticalPolicy().

Member Data Documentation

SmokeInvocation QtGui.QSizePolicy.interceptor
protected

Property Documentation

new QSizePolicy.ControlType QtGui.QSizePolicy.controlType
getset

Returns the control type associated with the widget for which this size policy applies.

This function was introduced in Qt 4.3.

Sets the control type associated with the widget for which this size policy applies to type.

The control type specifies the type of the widget for which this size policy applies. It is used by some styles, notably QMacStyle, to insert proper spacing between widgets. For example, the Mac OS X Aqua guidelines specify that push buttons should be separated by 12 pixels, whereas vertically stacked radio buttons only require 6 pixels.

This function was introduced in Qt 4.3.

new QSizePolicy.Policy QtGui.QSizePolicy.HorizontalPolicy
getset

Returns the horizontal component of the size policy.

Sets the horizontal component to the given policy.

virtual System.IntPtr QtGui.QSizePolicy.SmokeObject
getset
new QMetaObject QtGui.QSizePolicy.StaticMetaObject
staticget
new QSizePolicy.Policy QtGui.QSizePolicy.VerticalPolicy
getset

Returns the vertical component of the size policy.

Sets the vertical component to the given policy.