Qt:Документация 4.3.2/q3groupbox

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] Q3GroupBox Class Reference
[ Qt3Support module]

The Q3GroupBox widget provides a group box frame with a title. Далее...

 #include <Q3GroupBox>

This class is part of the Qt 3 support library. It is provided to keep old source code working. Мы настоятельно не рекомендуем использовать этот класс в новом коде. See Porting to Qt 4 for more information.

Inherits QGroupBox.

Inherited by Q3ButtonGroup, Q3HGroupBox, and Q3VGroupBox.

[править] Свойства

  • 5 properties inherited from QGroupBox
  • 56 свойств, унаследованных от QWidget
  • 1 свойство, унаследованное от QObject

[править] Открытые функции

  • 9 public functions inherited from QGroupBox
  • 201 свойство, унаследованное от QWidget
  • 29 открытых функций, унаследованных от QObject
  • 12 открытых функций, унаследованных от QPaintDevice

[править] Дополнительные унаследованные члены

  • 1 public slot inherited from QGroupBox
  • 19 открытых слотов, унаследованных от QWidget
  • 1 открытый слот, унаследованный от QObject
  • 2 signals inherited from QGroupBox
  • 1 сигнал, унаследованный от QWidget
  • 1 сигнал, унаследованный от QObject
  • 4 статических открытых члена, унаследованных от QWidget
  • 5 статических открытых членов, унаследованных от QObject
  • 1 protected function inherited from QGroupBox
  • 38 защищенных функций, унаследованных от QWidget
  • 7 защищенных функций, унаследованных от QObject
  • 1 защищенная функция, унаследованных от QPaintDevice
  • 1 защищенный слот, унаследованый от QWidget

[править] Подробное описание

The Q3GroupBox 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 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() and setInsideSpacing(). To minimize space consumption, you can remove the right, left and bottom edges of the frame with setFlat().

Смотрите также QButtonGroup.


[править] Описание cвойств

[править]
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 )

See also frameStyle().

[править]
frameShape : FrameShape

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

Функции доступа:

  • FrameShape frameShape () const
  • void setFrameShape ( FrameShape )

See also frameStyle() and frameShadow().

[править]
lineWidth : int

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

Функции доступа:

  • int lineWidth () const
  • void setLineWidth ( int )

See also frameStyle() and 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 )

See also frameStyle() and 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 arguments are passed to the QWidget constructor.

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 arguments are passed to the QWidget constructor.

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 arguments are passed to the QWidget constructor.

[править]
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 arguments are passed to the QWidget constructor.

[править]
Q3GroupBox::~Q3GroupBox ()

Destroys the group box.

[править]
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() is Horizontal) or height (if orientation() is 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.

[править]
int Q3GroupBox::frameStyle () const

Returns the frame style.

See also 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.

See also setInsideMargin() and 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.

See also setInsideSpacing() and orientation.

[править]
void Q3GroupBox::setColumnLayout ( int strips, Qt::Orientation direction ) [virtual]

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.

See also orientation and columns.

[править]
void Q3GroupBox::setFrameStyle ( int style )

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

See also frameStyle().

[править]
void Q3GroupBox::setInsideMargin ( int m )

Sets the the width of the inside margin to m pixels.

See also insideMargin().

[править]
void Q3GroupBox::setInsideSpacing ( int s )

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

See also insideSpacing().



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2