• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

Public Member Functions | Protected Member Functions | List of all members
K3ButtonBox Class Reference

#include <k3buttonbox.h>

Inheritance diagram for K3ButtonBox:
Inheritance graph
[legend]

Public Member Functions

 K3ButtonBox (QWidget *parent, Qt::Orientation _orientation=Qt::Horizontal, int border=0, int _autoborder=6)
 
 ~K3ButtonBox ()
 
QPushButton * addButton (const QString &text, bool noexpand=false)
 
QPushButton * addButton (const QString &text, QObject *receiver, const char *slot, bool noexpand=false)
 
QPushButton * addButton (const KGuiItem &guiitem, bool noexpand=false)
 
QPushButton * addButton (const KGuiItem &guiitem, QObject *receiver, const char *slot, bool noexpand=false)
 
void addStretch (int scale=1)
 
void layout ()
 
virtual void resizeEvent (QResizeEvent *)
 
virtual QSize sizeHint () const
 
virtual QSizePolicy sizePolicy () const
 

Protected Member Functions

QSize bestButtonSize () const
 
QSize buttonSizeHint (QPushButton *) const
 
void placeButtons ()
 

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.

Deprecated:
use KDialogButtonBox
Author
Mario Weilguni mweil.nosp@m.guni.nosp@m.@sime.nosp@m..com

Definition at line 44 of file k3buttonbox.h.

Constructor & Destructor Documentation

K3ButtonBox::K3ButtonBox ( QWidget *  parent,
Qt::Orientation  _orientation = Qt::Horizontal,
int  border = 0,
int  _autoborder = 6 
)
explicit

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.

Definition at line 82 of file k3buttonbox.cpp.

K3ButtonBox::~K3ButtonBox ( )

Free private data field.

Definition at line 93 of file k3buttonbox.cpp.

Member Function Documentation

QPushButton * K3ButtonBox::addButton ( const QString &  text,
bool  noexpand = false 
)

Add a new QPushButton.

Parameters
textthe text of the button to add
noexpandIf 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.

Definition at line 100 of file k3buttonbox.cpp.

QPushButton * K3ButtonBox::addButton ( const QString &  text,
QObject *  receiver,
const char *  slot,
bool  noexpand = false 
)

Add a new QPushButton.

Parameters
textthe text of the button to add.
receiverAn object to connect to.
slotA Qt slot to connect the 'clicked()' signal to.
noexpandIf 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.

Definition at line 125 of file k3buttonbox.cpp.

QPushButton * K3ButtonBox::addButton ( const KGuiItem &  guiitem,
bool  noexpand = false 
)

Add a new QPushButton.

Parameters
guiitemtext and icon on the button
noexpandIf 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.

Definition at line 112 of file k3buttonbox.cpp.

QPushButton * K3ButtonBox::addButton ( const KGuiItem &  guiitem,
QObject *  receiver,
const char *  slot,
bool  noexpand = false 
)

Add a new QPushButton.

Parameters
guiitemtext and icon on the button
receiverAn object to connect to.
slotA Qt slot to connect the 'clicked()' signal to.
noexpandIf 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.

Definition at line 141 of file k3buttonbox.cpp.

void K3ButtonBox::addStretch ( int  scale = 1)

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

Definition at line 156 of file k3buttonbox.cpp.

QSize K3ButtonBox::bestButtonSize ( ) const
protected
Returns
the best size for a button. Checks all buttons and takes the maximum width/height.

Definition at line 261 of file k3buttonbox.cpp.

QSize K3ButtonBox::buttonSizeHint ( QPushButton *  b) const
protected

Definition at line 336 of file k3buttonbox.cpp.

void K3ButtonBox::layout ( )

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

It will start layout control.

Definition at line 165 of file k3buttonbox.cpp.

void K3ButtonBox::placeButtons ( )
protected

Definition at line 182 of file k3buttonbox.cpp.

void K3ButtonBox::resizeEvent ( QResizeEvent *  )
virtual

Definition at line 257 of file k3buttonbox.cpp.

QSize K3ButtonBox::sizeHint ( void  ) const
virtual
Returns
The minimum size needed to fit all buttons.

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

Definition at line 285 of file k3buttonbox.cpp.

QSizePolicy K3ButtonBox::sizePolicy ( ) const
virtual

Definition at line 324 of file k3buttonbox.cpp.


The documentation for this class was generated from the following files:
  • k3buttonbox.h
  • k3buttonbox.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal