kalarm/lib
buttongroup.h
Go to the documentation of this file.00001 /* 00002 * buttongroup.h - QButtonGroup with an extra signal, and button IDs 00003 * Program: kalarm 00004 * Copyright © 2002,2004,2005,2008 by David Jarvie <djarvie@kde.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef BUTTONGROUP_H 00021 #define BUTTONGROUP_H 00022 00023 #include <QButtonGroup> 00024 #include <QMap> 00025 class QAbstractButton; 00026 00027 00042 class ButtonGroup : public QButtonGroup 00043 { 00044 Q_OBJECT 00045 public: 00049 explicit ButtonGroup(QObject* parent); 00055 void addButton(QAbstractButton* button); 00060 void addButton(QAbstractButton* button, int id); 00064 int id(QAbstractButton* button) const; 00068 QAbstractButton* find(int id) const; 00072 int selectedId() const; 00076 void setButton(int id); 00077 signals: 00082 void buttonSet(QAbstractButton* button); 00083 00084 private slots: 00085 void slotButtonToggled(bool); 00086 00087 private: 00088 QMap<int, QAbstractButton*> mIds; 00089 }; 00090 00091 #endif // BUTTONGROUP_H
KDE 4.2 API Reference