Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TestClass.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2013 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK 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 Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 #ifndef TESTCLASS_H_
26 #define TESTCLASS_H_
27 
28 // -- QT stuff
29 #include <QObject>
30 #include <QVariant>
31 #include <QVector3D>
32 #include <QColor>
33 #include <QFont>
34 #include <QTime>
35 
40 class TestClass : public QObject
41 {
42  Q_OBJECT
43 
45  Q_PROPERTY( bool myBool READ getBool WRITE setBool );
47  Q_PROPERTY(double radius READ getRadius WRITE setRadius)
49  Q_PROPERTY(QVector3D position READ getPosition WRITE setPosition );
51  Q_PROPERTY(QString name READ getName WRITE setName)
52 
54  Q_PROPERTY(QColor color READ getColor WRITE setColor)
55 
57  Q_PROPERTY(QFont font READ getFont WRITE setFont)
58 
60  Q_PROPERTY(QTime time READ getTime WRITE setTime)
61 
63  Q_PROPERTY( StateLevel yourForm READ getLevel WRITE setLevel )
65  Q_ENUMS( StateLevel )
66 
74  Q_PROPERTY(QVariantMap propertyGroup READ getGroup WRITE setGroup)
75 
77  Q_PROPERTY(bool onWindows READ getOnWindows)
78 
80  Q_PROPERTY(int someNumber READ getSomeNumber)
81 
82 public:
84 
85  TestClass();
86  virtual ~TestClass();
87 
88  bool getBool() const {
89  return myBool;
90  };
91  void setBool( bool newBool);
92 
93  double getRadius() const {
94  return radius;
95  }
96  void setRadius(double radius);
97 
98  QVector3D getPosition() const {
99  return position;
100  };
101  void setPosition( QVector3D newV3D);
102 
103  QString getName() const {
104  return name;
105  }
106  void setName(const QString& name);
107 
108  QColor getColor() const {
109  return color;
110  }
111  void setColor(const QColor& color);
112 
113  QFont getFont() const {
114  return font;
115  }
116  void setFont(const QFont &font);
117 
118  QTime getTime() const {
119  return time;
120  }
121  void setTime(const QTime &time);
122 
124  return yourForm;
125  }
126  void setLevel( StateLevel );
127 
128 
129  QVariantMap getGroup() const {
130  return propertyGroup;
131  }
132  void setGroup(const QVariantMap &);
133 
134  int getSomeNumber() const {
135  return someNumber;
136  }
137 
138  bool getOnWindows() const {
139 #if defined(_WIN32) || defined(__MINGW32__)
140  return true;
141 #else
142  return false;
143 #endif
144  }
145 
147  virtual bool event(QEvent* e);
148 
149 private:
151  bool myBool;
152  double radius;
153  QVector3D position;
154  QString name;
155  QColor color;
156  QFont font;
157  QTime time;
159  bool onWindows;
160  int someNumber;
161  QVariantMap propertyGroup;
162 
165 };
166 
167 
168 #endif