kbuttonbox.h
/* This file is part of the KDE libraries
Copyright (C) 1997 Mario Weilguni (mweilguni@sime.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __KBUTTONBOX__H__
#define __KBUTTONBOX__H__
#include <kdelibs_export.h>
#include <qwidget.h>
class QPushButton;
class KGuiItem;
class KButtonBoxPrivate;
class KDEUI_EXPORT KButtonBox : public QWidget
{
Q_OBJECT
public:
KButtonBox(QWidget *parent, Orientation _orientation = Horizontal,
int border = 0, int _autoborder = 6);
~KButtonBox();
virtual QSize sizeHint() const;
virtual QSizePolicy sizePolicy() const;
virtual void resizeEvent(QResizeEvent *);
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();
public: // as PrivateData needs Item, it has to be exported
class Item;
protected:
QSize bestButtonSize() const;
void placeButtons();
QSize buttonSizeHint(QPushButton *) const;
protected:
virtual void virtual_hook( int id, void* data );
private:
KButtonBoxPrivate* const data;
};
#endif
KButtonBox
Container widget for buttons.
Definition: kbuttonbox.h:42
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:38

KDE Home | KDE Accessibility Home | Description of Access Keys