Moka Ihm Qt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
IdWidgets.qt.cc
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 #include "IdWidgets.qt.hh"
25 
26 
27 IdPushButton::IdPushButton ( int id, QWidget * parent )
28  : QPushButton(parent), id(id)
29 {
30  connect(this,SIGNAL(clicked()),this,SLOT(emitClicked()));
31 }
32 
33 
34 IdPushButton::IdPushButton ( int id, const QString & text, QWidget * parent )
35  : QPushButton(text, parent), id(id)
36 {
37  connect(this,SIGNAL(clicked()),this,SLOT(emitClicked()));
38 }
39 
40 
41 IdPushButton::IdPushButton ( int id, const QIcon & icon, const QString & text, QWidget * parent )
42  : QPushButton(icon, text, parent), id(id)
43 {
44  connect(this,SIGNAL(clicked()),this,SLOT(emitClicked()));
45 }
46 
47 
49 {
50 
51 }
52 
53 
54 void IdPushButton::emitClicked()
55 {
56  emit clicked(id);
57 }
58 
59 
60 
61 
62 // ---------------------------------------------------
63 
64 
65 
66 
67 IdRadioButton::IdRadioButton ( int id, QWidget * parent )
68  : QRadioButton(parent), id(id)
69 {
70  connect(this,SIGNAL(clicked()),this,SLOT(emitClicked()));
71 }
72 
73 
74 IdRadioButton::IdRadioButton ( int id, const QString & text, QWidget * parent )
75  : QRadioButton(text, parent), id(id)
76 {
77  connect(this,SIGNAL(clicked()),this,SLOT(emitClicked()));
78 }
79 
80 
81 
83 {
84 
85 }
86 
87 
88 void IdRadioButton::emitClicked()
89 {
90  emit clicked(id);
91 }
92 
93 
94 
95 
96 // ---------------------------------------------------
97 
98 
99 IdAction::IdAction ( int id, QObject * parent )
100  : QAction(parent), id(id)
101 {
102  connect(this,SIGNAL(triggered(bool)),this,SLOT(emitClicked()));
103 }
104 
105 IdAction::IdAction ( int id, const QString & text, QObject * parent )
106  : QAction(text,parent), id(id)
107 {
108  connect(this,SIGNAL(triggered(bool)),this,SLOT(emitClicked()));
109 }
110 
111 
112 IdAction::IdAction ( int id, const QIcon & icon, const QString & text, QObject * parent )
113  : QAction(icon,text,parent), id(id)
114 {
115  connect(this,SIGNAL(triggered(bool)),this,SLOT(emitClicked()));
116 }
117 
118 
119 
121 {
122 
123 }
124 
125 
126 void IdAction::emitClicked()
127 {
128  emit clicked(id);
129 }