Public Members
- enum {VERTICAL = 1, HORIZONTAL = 2 }
- KButtonBox (QWidget *parent, int _orientation = HORIZONTAL, int border = 0, int _autoborder = 6)
- ~KButtonBox ()
- virtual QSize sizeHint () const
- virtual void resizeEvent (QResizeEvent *)
- QPushButton * addButton (const char *text, bool noexpand = FALSE)
- void addStretch (int scale = 1)
- void layout ()
Protected Members
- QSize bestButtonSize () const
- void placeButtons ()
- QSize buttonSizeHint (QPushButton *) const
- int _border
- int _autoborder
- int orientation
- bool activated
- QList<KButtonBoxItem> buttons
KButtonBox (QWidget *parent, int _orientation = HORIZONTAL, int border = 0, int _autoborder = 6)
|
Creates an empty container for buttons. If _orientation is
KButtonBox::VERTICAL, the buttons inserted with @see addButton
are layouted from top to bottom, otherwise they are layouted
from left to right.
The destructor is needed, otherwise gcc 2.7.2.1 may report an
internal compiler error. It does nothing.
[const virtual]
Returns: the minimum size needed to fit all buttons. This size is
calculated by the with/height of all buttons plus border/autoborder
Reimplemented from QWidget
QPushButton * addButton (const char *text, bool noexpand = FALSE)
|
adds a new @see QPushButton and @return a pointer to the newly
created button. 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).
void addStretch (int scale = 1)
|
This adds a stretch to the buttonbox. @see QBoxLayout for details.
Can be used to separate buttons (i.e. if you add the buttons "OK",
"Cancel", add a stretch and then add the button "Help", "OK" and
"Cancel" will be left-aligned (or top-aligned for vertical) while
"Help" will be right-aligned (or bottom-aligned for vertical).
This function must be called ONCE after all buttons have been
inserted. It will start layout control.
[protected const]
Returns: the best size for a button. Checks all buttons and takes
the maximum width/height.
Generated by: root@jedi.mandrakesoft.com on Sat Dec 25 21:35:43 199. |