Moka Ihm Qt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
IdWidgets.qt.hh
Go to the documentation of this file.
1 /*
2  * Moka : Un modeleur de 3-G-cartes.
3  * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6  * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7  *
8  * This file is part of Moka
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef _IDWIDGETS_H
25 #define _IDWIDGETS_H
26 
27 #include <QtGui/QPushButton>
28 #include <QtGui/QRadioButton>
29 #include <QtGui/QAction>
30 #include <QtGui/QWidget>
31 
32 
33 // Des QPushButton avec un identifiant.
34 
35 class IdPushButton : public QPushButton
36 {
37  Q_OBJECT
38 
39  public:
40 
41  IdPushButton ( int id, QWidget * parent = 0 ) ;
42  IdPushButton ( int id, const QString & text, QWidget * parent = 0 ) ;
43  IdPushButton ( int id, const QIcon & icon, const QString & text,
44  QWidget * parent = 0 ) ;
45  ~IdPushButton ( ) ;
46 
47  signals:
48 
49  void clicked(int id);
50 
51  private slots:
52 
53  void emitClicked();
54 
55  private:
56 
57  int id;
58 };
59 
60 
61 
62 // Des QRadioButton avec un identifiant.
63 
64 class IdRadioButton : public QRadioButton
65 {
66  Q_OBJECT
67 
68  public:
69 
70  IdRadioButton ( int id, QWidget * parent = 0 ) ;
71  IdRadioButton ( int id, const QString & text, QWidget * parent = 0 ) ;
72  ~IdRadioButton ( ) ;
73 
74  signals:
75 
76  void clicked(int id);
77 
78  private slots:
79 
80  void emitClicked();
81 
82  private:
83 
84  int id;
85 };
86 
87 
88 
89 // Des QAction avec un identifiant.
90 
91 class IdAction : public QAction
92 {
93  Q_OBJECT
94 
95  public:
96 
97  IdAction ( int id, QObject * parent ) ;
98  IdAction ( int id, const QString & text, QObject * parent ) ;
99  IdAction ( int id, const QIcon & icon, const QString & text,
100  QObject * parent );
101 
102 
103  ~IdAction ( ) ;
104 
105  signals:
106 
107  void clicked(int id);
108 
109  private slots:
110 
111  void emitClicked();
112 
113  private:
114 
115  int id;
116 };
117 
118 #endif