class KButtonBox

# class KButtonBox | Container widget for buttons. More...
Definition | `#include <kbuttonbox.h>`
Inherits | QWidget (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KButtonBox (QWidget *parent, Orientation _orientation = Horizontal, int border = 0, int _autoborder = 6)
- ~KButtonBox ()
- virtual QSize sizeHint () const
- QPushButton * addButton (const QString& text, bool noexpand = FALSE)
- QPushButton * addButton (const QString& text, QObject * receiver, const char * slot, bool noexpand = FALSE)
- void addStretch (int scale = 1)
- void layout ()

#### Public Members

- Forward Item

#### Protected Methods

- QSize bestButtonSize () const
- void placeButtons ()
- QSize buttonSizeHint (QPushButton *) const
- virtual void virtual_hook ( int id, void* data )

## Detailed Description

Container widget for buttons.

This class uses Qt layout control to place the buttons; can handle both vertical and horizontal button placement. The default border is now `0` (making it easier to deal with layouts). The space between buttons is now more Motif compliant.

KButtonBox (QWidget *parent, Orientation _orientation = Horizontal, int border = 0, int _autoborder = 6) | ### KButtonBox

Create an empty container for buttons.

If `_orientation` is `Vertical`, the buttons inserted with addButton() are laid out from top to bottom, otherwise they are laid out from left to right.

~KButtonBox () | ### ~KButtonBox

Free private data field

QSize sizeHint () | ### sizeHint

[const virtual]

This size is calculated by the width/height of all buttons plus border/autoborder.

Returns: The minimum size needed to fit all buttons.

QSizePolicy sizePolicy () | ### sizePolicy

[const virtual]

Reimplemented from QWidget for internal purposes..

void resizeEvent (QResizeEvent *) | ### resizeEvent

[virtual]

QPushButton * addButton (const QString& text, bool noexpand = FALSE) | ### addButton

Add a new QPushButton.

Parameters:

noexpand | If `noexpand` is `false`, the width of the button is adjusted to fit the other buttons (the maximum of all buttons is taken). If `noexpand` is `true`, the width of this button will be set to the minimum width needed for the given text).

Returns: A pointer to the new button.

QPushButton * addButton (const QString& text, QObject * receiver, const char * slot, bool noexpand = FALSE) | ### addButton

Add a new QPushButton.

Parameters:

receiver | An object to connect to.
slot | A Qt slot to connect the 'clicked()' signal to.
noexpand | If `noexpand` is `false`, the width of the button is adjusted to fit the other buttons (the maximum of all buttons is taken). If `noexpand` `true`, the width of this button will be set to the minimum width needed for the given text).

Returns: A pointer to the new button.

void addStretch (int scale = 1) | ### addStretch

Add a stretch to the buttonbox.

Can be used to separate buttons. That is, if you add the buttons OK and Cancel, add a stretch, and then add the button Help, the buttons OK and Cancel will be left-aligned (or top-aligned for vertical) whereas Help will be right-aligned (or bottom-aligned for vertical).

See also: QBoxLayout

void layout () | ### layout

This function must be called once after all buttons have been inserted.

It will start layout control.

QSize bestButtonSize () | ### bestButtonSize

[protected const]

Returns: the best size for a button. Checks all buttons and takes the maximum width/height.

void placeButtons () | ### placeButtons

[protected]

QSize buttonSizeHint (QPushButton *) | ### buttonSizeHint

[protected const]

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

- Version: $Id: kbuttonbox.h,v 1.26 2002/03/04 00:51:46 lunakl Exp $
- Author: Mario Weilguni
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:37 2003, using kdoc 2.0a54.