Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

  • Qt 4.8
  • Qt3SupportLight
  • Q3GroupBox

Q3GroupBox Class

TheQ3GroupBox widget provides a group box frame with a title.More...

Header:#include <Q3GroupBox>
Inherits:QGroupBox
Inherited By:

Q3ButtonGroup,Q3HGroupBox, andQ3VGroupBox

Properties

Public Functions

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()
voidaddSpace(int size)
intcolumns() const
FrameShapeframeShadow() const
FrameShapeframeShape() const
intframeStyle() const
intinsideMargin() const
intinsideSpacing() const
intlineWidth() const
intmargin() const
intmidLineWidth() const
Qt::Orientationorientation() const
virtual voidsetColumnLayout(int strips, Qt::Orientation direction)
voidsetColumns(int)
voidsetFrameShadow(FrameShape)
voidsetFrameShape(FrameShape)
voidsetFrameStyle(int style)
voidsetInsideMargin(int m)
voidsetInsideSpacing(int s)
voidsetLineWidth(int)
voidsetMargin(int margin)
voidsetMidLineWidth(int)
voidsetOrientation(Qt::Orientation)

Reimplemented Protected Functions

virtual voidchangeEvent(QEvent * ev)
virtual voidchildEvent(QChildEvent * c)
virtual boolevent(QEvent * e)
virtual voidresizeEvent(QResizeEvent * e)
  • 10 protected functions inherited fromQGroupBox
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice

Additional Inherited Members

  • 1 public slot inherited fromQGroupBox
  • 19 public slots inherited fromQWidget
  • 1 public slot inherited fromQObject
  • 2 signals inherited fromQGroupBox
  • 1 signal inherited fromQWidget
  • 1 signal inherited fromQObject
  • 4 static public members inherited fromQWidget
  • 7 static public members inherited fromQObject
  • 10 protected functions inherited fromQGroupBox
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice
  • 1 protected slot inherited fromQWidget

Detailed Description

TheQ3GroupBox widget provides a group box frame with a title.

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 theorientation() and number ofcolumns() after construction, or to ignore all the automatic layout support and manage the layout yourself. You can add 'empty' spaces to the group box withaddSpace().

Q3GroupBox also lets you set thetitle() (normally set in the constructor) and the title'salignment().

You can change the spacing used by the group box withsetInsideMargin() andsetInsideSpacing(). To minimize space consumption, you can remove the right, left and bottom edges of the frame withsetFlat().

See alsoQButtonGroup.

Property Documentation

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.

Access functions:

intcolumns() const
voidsetColumns(int)

frameRect : constQRect

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.

Access functions:

FrameShapeframeShadow() const
voidsetFrameShadow(FrameShape)

See alsoframeStyle().

frameShape :FrameShape

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

Access functions:

FrameShapeframeShape() const
voidsetFrameShape(FrameShape)

See alsoframeStyle() andframeShadow().

lineWidth :int

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

Access functions:

intlineWidth() const
voidsetLineWidth(int)

See alsoframeStyle() andframeShadow().

margin :int

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

Access functions:

intmargin() const
voidsetMargin(int margin)

midLineWidth :int

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

Access functions:

intmidLineWidth() const
voidsetMidLineWidth(int)

See alsoframeStyle() andframeShadow().

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.

Access functions:

Qt::Orientationorientation() const
voidsetOrientation(Qt::Orientation)

Member Function Documentation

Q3GroupBox::Q3GroupBox(QWidget * parent = 0, constchar * name = 0)

Constructs a group box widget with no title.

Theparent andname arguments are passed to theQWidget constructor.

This constructor does not do automatic layout.

Q3GroupBox::Q3GroupBox(constQString & title,QWidget * parent = 0, constchar * name = 0)

Constructs a group box with the titletitle.

Theparent andname arguments are passed to theQWidget constructor.

This constructor does not do automatic layout.

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

Constructs a group box with no title. Child widgets will be arranged instrips rows or columns (depending onorientation).

Theparent andname arguments are passed to theQWidget constructor.

Q3GroupBox::Q3GroupBox(int strips,Qt::Orientation orientation, constQString & title,QWidget * parent = 0, constchar * name = 0)

Constructs a group box titledtitle. Child widgets will be arranged instrips rows or columns (depending onorientation).

Theparent andname arguments are passed to theQWidget constructor.

Q3GroupBox::~Q3GroupBox()

Destroys the group box.

void Q3GroupBox::addSpace(int size)

Adds an empty cell at the next free position. Ifsize is greater than 0, the empty cell takessize to be its fixed width (iforientation() isHorizontal) or height (iforientation() isVertical).

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 callingsetColumnLayout() or by changing theQ3GroupBox::columns orQ3GroupBox::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)

Reimplemented fromQWidget::changeEvent().

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

Reimplemented fromQObject::childEvent().

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

Reimplemented fromQObject::event().

int Q3GroupBox::frameStyle() const

Returns the frame style.

See alsosetFrameStyle().

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.

See alsosetInsideMargin() andorientation.

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.

See alsosetInsideSpacing() andorientation.

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

Reimplemented fromQWidget::resizeEvent().

[virtual]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 bestrips, depending ondirection.

See alsoorientation andcolumns.

void Q3GroupBox::setFrameStyle(int style)

Sets the frame style tostyle. The style is the bitwise OR between a frame shape and a frame shadow style.

See alsoframeStyle().

void Q3GroupBox::setInsideMargin(int m)

Sets the width of the inside margin tom pixels.

See alsoinsideMargin().

void Q3GroupBox::setInsideSpacing(int s)

Sets the width of the empty space between each of the items in the group tos pixels.

See alsoinsideSpacing().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp