Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QHBoxWidget Class Reference

The QHBoxWidget class provides horizontal geometry management for its child widgets. More...

    #include <QHBoxWidget>

Inherits QFrame.

Inherited by QVBoxWidget.

- List of all members, including inherited members
- Obsolete members

### Writable Properties

- 5 writable properties inherited from QFrame
- 33 writable properties inherited from QWidget
- 1 writable property inherited from QObject

### Read-Only Properties

- 1 read-only property inherited from QFrame
- 24 read-only properties inherited from QWidget

### Public Functions

- QHBoxWidget ( QWidget * parent = 0, Qt::WFlags f = 0 )
- void setMargin ( int margin )
- void setSpacing ( int space )
- bool setStretchFactor ( QWidget * w, int stretch )

- 2 public functions inherited from QFrame
- 83 public functions inherited from QWidget
- 24 public functions inherited from QObject
- 2 public functions inherited from QPaintDevice

### Public Slots

- 16 public slots inherited from QWidget
- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QWidget
- 4 static public members inherited from QObject

### Protected Functions

- QHBoxWidget ( Qt::Orientation orientation, QWidget * parent, Qt::WFlags f )

- 44 protected functions inherited from QWidget
- 9 protected functions inherited from QObject

## Detailed Description

The QHBoxWidget class provides horizontal geometry management for its child widgets.

All the horizontal box's child widgets will be placed alongside each other and sized according to their sizeHint()s.

Use setMargin() to add space around the edges, and use setSpacing() to add space between the widgets. Use setStretchFactor() if you want the widgets to be different sizes in proportion to one another. (See Layouts for more information on stretch factors.)

If you just need a layout (not a widget) use QHBoxLayout instead.

See also QVBoxWidget and QGridWidget.

## Member Function Documentation

### QHBoxWidget::QHBoxWidget ( QWidget * parent = 0, Qt::WFlags f = 0 )

Constructs an hbox widget with parent parent. The parent and widget flags, f, are passed to the QFrame constructor.

### QHBoxWidget::QHBoxWidget ( Qt::Orientation orientation, QWidget * parent, Qt::WFlags f ) `[protected]`

Constructs a horizontal hbox if orientation is `Qt::Horizontal`, and constructs a vertical hbox (i.e. a vbox) if orientation is `Qt::Vertical`.

This constructor is provided for the QVBox class. You should never need to use it directly.

The parent and widget flags, f, are passed to the QFrame constructor.

### void QHBoxWidget::setMargin ( int margin )

Set the width of the outside border margin

### void QHBoxWidget::setSpacing ( int space )

Sets the spacing between the child widgets to space.

### bool QHBoxWidget::setStretchFactor ( QWidget * w, int stretch )

Sets the stretch factor of widget w to stretch. Returns true if w is found. Otherwise returns false.

See also QBoxLayout::setStretchFactor() and Layouts.