itom  4.1.0
qVector3DProperty.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef QVECTOR3DPROPERTY_H
29 #define QVECTOR3DPROPERTY_H
30 
31 #include <qvector3d.h>
32 #include <qvariant.h>
33 #include "Property.h"
34 
35 
36 class Property;
37 class QObject;
38 
39 
40 namespace ito
41 {
42  class QVector3DProperty : public Property
43  {
44  Q_OBJECT
45  Q_PROPERTY(float x READ x WRITE setX DESIGNABLE true USER true)
46  Q_PROPERTY(float y READ y WRITE setY DESIGNABLE true USER true)
47  Q_PROPERTY(float z READ z WRITE setZ DESIGNABLE true USER true)
48 
49  public:
50  QVector3DProperty(const QString& name = QString(), QObject* propertyObject = 0, QObject* parent = 0);
51 
52  QVariant value(int role = Qt::UserRole) const;
53  virtual void setValue(const QVariant& value);
54 
55  void setEditorHints(const QString& hints);
56 
57  float x() const;
58  void setX(float x);
59 
60  float y() const;
61  void setY(float y);
62 
63  float z() const;
64  void setZ(float z);
65 
66  private:
67  QString parseHints(const QString& hints, const QChar component);
68 
69  Property* m_x;
70  Property* m_y;
71  Property* m_z;
72  };
73 
74 }
75 #endif //QVECTOR3DPROPERTY_H
Definition: apiFunctionsGraph.cpp:39
QVariant value(int role=Qt::UserRole) const
Definition: qVector3DProperty.cpp:45
Definition: Property.h:40
Definition: qVector3DProperty.h:42
QObject * propertyObject()
Definition: Property.h:77
virtual void setValue(const QVariant &value)
Definition: qVector3DProperty.cpp:61
void setEditorHints(const QString &hints)
Definition: qVector3DProperty.cpp:93