Q3GroupBox Class

The Q3GroupBox 小部件提供帶有標題的組框框架。 更多...

頭: #include <Q3GroupBox>
繼承: QGroupBox
繼承者: Q3ButtonGroup , Q3HGroupBox ,和 Q3VGroupBox

特性

公共函數

Q3GroupBox (QWidget * parent = 0, const char * name = 0)
Q3GroupBox (const QString & title , QWidget * parent = 0, const char * name = 0)
Q3GroupBox (int strips , Qt::Orientation orientation , QWidget * parent = 0, const char * name = 0)
Q3GroupBox (int strips , Qt::Orientation orientation , const QString & title , QWidget * parent = 0, const char * name = 0)
~Q3GroupBox ()
void addSpace (int size )
int columns () const
FrameShape frameShadow () const
FrameShape frameShape () const
int frameStyle () const
int insideMargin () const
int insideSpacing () const
int lineWidth () const
int margin () const
int midLineWidth () const
Qt::Orientation orientation () const
virtual void setColumnLayout (int strips , Qt::Orientation direction )
void setColumns (int)
void setFrameShadow (FrameShape)
void setFrameShape (FrameShape)
void setFrameStyle (int style )
void setInsideMargin (int m )
void setInsideSpacing (int s )
void setLineWidth (int)
void setMargin (int margin )
void setMidLineWidth (int)
void setOrientation (Qt::Orientation)

重實現保護函數

virtual void changeEvent (QEvent * ev )
virtual void childEvent (QChildEvent * c )
virtual bool event (QEvent * e )
virtual void resizeEvent (QResizeEvent * e )

額外繼承成員

詳細描述

The Q3GroupBox 小部件提供帶有標題的組框框架。

A group box provides a frame, a title and a keyboard shortcut, and displays various other widgets inside itself. The title is on top, the keyboard shortcut moves keyboard focus to one of the group box's child widgets, and the child widgets are usually laid out horizontally (or vertically) inside the frame.

The simplest way to use it is to create a group box with the desired number of columns (or rows) and orientation, and then just create widgets with the group box as parent.

It is also possible to change the orientation () and number of columns () after construction, or to ignore all the automatic layout support and manage the layout yourself. You can add 'empty' spaces to the group box with addSpace ().

Q3GroupBox also lets you set the title () (normally set in the constructor) and the title's alignment ().

You can change the spacing used by the group box with setInsideMargin () 和 setInsideSpacing (). To minimize space consumption, you can remove the right, left and bottom edges of the frame with setFlat ().

另請參閱 QButtonGroup .

特性文檔編製

columns : int

This property holds the number of columns or rows (depending on Q3GroupBox::orientation) in the group box.

Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is best to set the number of columns directly in the constructor.

訪問函數:

int columns () const
void setColumns (int)

frameRect : const QRect

This property holds the bounding rectangle of the frame of the group box.

frameShadow : FrameShape

This property holds the frame shadow value from the frame style.

訪問函數:

FrameShape frameShadow () const
void setFrameShadow (FrameShape)

另請參閱 frameStyle ().

frameShape : FrameShape

This property holds the frame shape value from the frame style.

訪問函數:

FrameShape frameShape () const
void setFrameShape (FrameShape)

另請參閱 frameStyle () 和 frameShadow ().

lineWidth : int

This property holds this property holds the width of the line.

訪問函數:

int lineWidth () const
void setLineWidth (int)

另請參閱 frameStyle () 和 frameShadow ().

margin : int

This property holds the width of the margin around the contents of the group box.

訪問函數:

int margin () const
void setMargin (int margin )

midLineWidth : int

This property holds this property holds the width of the mid-line.

訪問函數:

int midLineWidth () const
void setMidLineWidth (int)

另請參閱 frameStyle () 和 frameShadow ().

orientation : Qt::Orientation

This property holds the group box's orientation.

A horizontal group box arranges its children in columns, while a vertical group box arranges them in rows.

Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is better to set the orientation directly in the constructor.

訪問函數:

Qt::Orientation orientation () const
void setOrientation (Qt::Orientation)

成員函數文檔編製

Q3GroupBox:: Q3GroupBox ( QWidget * parent = 0, const char * name = 0)

Constructs a group box widget with no title.

The parent and name 自變量被傳遞給 QWidget 構造函數。

This constructor does not do automatic layout.

Q3GroupBox:: Q3GroupBox (const QString & title , QWidget * parent = 0, const char * name = 0)

Constructs a group box with the title title .

The parent and name 自變量被傳遞給 QWidget 構造函數。

This constructor does not do automatic layout.

Q3GroupBox:: Q3GroupBox ( int strips , Qt::Orientation orientation , QWidget * parent = 0, const char * name = 0)

Constructs a group box with no title. Child widgets will be arranged in strips rows or columns (depending on orientation ).

The parent and name 自變量被傳遞給 QWidget 構造函數。

Q3GroupBox:: Q3GroupBox ( int strips , Qt::Orientation orientation , const QString & title , QWidget * parent = 0, const char * name = 0)

Constructs a group box titled title . Child widgets will be arranged in strips rows or columns (depending on orientation ).

The parent and name 自變量被傳遞給 QWidget 構造函數。

Q3GroupBox:: ~Q3GroupBox ()

銷毀組框。

void Q3GroupBox:: addSpace ( int size )

Adds an empty cell at the next free position. If size is greater than 0, the empty cell takes size to be its fixed width (if orientation () 是 Horizontal ) or height (if orientation () 是 Vertical ).

Use this method to separate the widgets in the group box or to skip the next free cell. For performance reasons, call this method after calling setColumnLayout () or by changing the Q3GroupBox::columns or Q3GroupBox::orientation properties. It is generally a good idea to call these methods first (if needed at all), and insert the widgets and spaces afterwards.

[virtual protected] void Q3GroupBox:: changeEvent ( QEvent * ev )

重實現自 QWidget::changeEvent ().

[virtual protected] void Q3GroupBox:: childEvent ( QChildEvent * c )

重實現自 QObject::childEvent ().

[virtual protected] bool Q3GroupBox:: event ( QEvent * e )

重實現自 QObject::event ().

int Q3GroupBox:: frameStyle () const

返迴框架樣式。

另請參閱 setFrameStyle ().

int Q3GroupBox:: insideMargin () const

Returns the width of the empty space between the items in the group and the frame of the group.

Only applies if the group box has a defined orientation.

The default is usually 11, by may vary depending on the platform and style.

另請參閱 setInsideMargin () 和 orientation .

int Q3GroupBox:: insideSpacing () const

Returns the width of the empty space between each of the items in the group.

Only applies if the group box has a defined orientation.

The default is usually 5, by may vary depending on the platform and style.

另請參閱 setInsideSpacing () 和 orientation .

[virtual protected] void Q3GroupBox:: resizeEvent ( QResizeEvent * e )

重實現自 QWidget::resizeEvent ().

[虛擬] void Q3GroupBox:: setColumnLayout ( int strips , Qt::Orientation direction )

Changes the layout of the group box. This function is only useful in combination with the default constructor that does not take any layout information. This function will put all existing children in the new layout. It is not good Qt programming style to call this function after children have been inserted. Sets the number of columns or rows to be strips , depending on direction .

另請參閱 orientation and columns .

void Q3GroupBox:: setFrameStyle ( int style )

將框架樣式設為 style . The style is the bitwise OR between a frame shape and a frame shadow style.

另請參閱 frameStyle ().

void Q3GroupBox:: setInsideMargin ( int m )

Sets the width of the inside margin to m 像素。

另請參閱 insideMargin ().

void Q3GroupBox:: setInsideSpacing ( int s )

Sets the width of the empty space between each of the items in the group to s 像素。

另請參閱 insideSpacing ().