QSpacerItem Class Reference

[ QtGui module]

QSpacerItem 类在布局中提供空白空间。 更多...

继承 QLayoutItem .

方法


详细描述

QSpacerItem 类在布局中提供空白空间。

Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating empty space in layouts:

Class 函数
QHBoxLayout addSpacing() , addStretch() , insertSpacing() , insertStretch()
QGridLayout setRowMinimumHeight() , setRowStretch() , setColumnMinimumWidth() , setColumnStretch()

方法文档编制

QSpacerItem.__init__ ( self , int  w , int  h , QSizePolicy.Policy   hPolicy  = QSizePolicy.Minimum, QSizePolicy.Policy   vPolicy  = QSizePolicy.Minimum)

Constructs a spacer item with preferred width w , preferred height h , horizontal size policy hPolicy and vertical size policy vPolicy .

The default values provide a gap that is able to stretch if nothing else wants the space.

QSpacerItem.__init__ ( self , QSpacerItem )

QSpacerItem.changeSize ( self , int  w , int  h , QSizePolicy.Policy   hPolicy  = QSizePolicy.Minimum, QSizePolicy.Policy   vPolicy  = QSizePolicy.Minimum)

Changes this spacer item to have preferred width w , preferred height h , horizontal size policy hPolicy and vertical size policy vPolicy .

The default values provide a gap that is able to stretch if nothing else wants the space.

Note that if changeSize() is called after the spacer item has been added to a layout, it is necessary to invalidate the layout in order for the spacer item's new size to take effect.

另请参阅 QSpacerItem.invalidate ().

Qt.Orientations QSpacerItem.expandingDirections ( self )

重实现自 QLayoutItem.expandingDirections ().

QRect QSpacerItem.geometry ( self )

重实现自 QLayoutItem.geometry ().

另请参阅 setGeometry ().

bool QSpacerItem.isEmpty ( self )

重实现自 QLayoutItem.isEmpty ().

Returns true.

QSize QSpacerItem.maximumSize ( self )

重实现自 QLayoutItem.maximumSize ().

QSize QSpacerItem.minimumSize ( self )

重实现自 QLayoutItem.minimumSize ().

QSpacerItem.setGeometry ( self , QRect )

重实现自 QLayoutItem.setGeometry ().

另请参阅 geometry ().

QSize QSpacerItem.sizeHint ( self )

重实现自 QLayoutItem.sizeHint ().

QSpacerItem QSpacerItem.spacerItem ( self )

重实现自 QLayoutItem.spacerItem ().

返回指向此对象的指针。