itom  4.1.0
qVector4DProperty.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 QVECTOR4DPROPERTY_H
29 #define QVECTOR4DPROPERTY_H
30 
31 #include <qvector4d.h>
32 #include <qvariant.h>
33 #include "Property.h"
34 
35 class Property;
36 class QObject;
37 
38 
39 namespace ito
40 {
41  class QVector4DProperty : public Property
42  {
43  Q_OBJECT
44  Q_PROPERTY(float x READ x WRITE setX DESIGNABLE true USER true)
45  Q_PROPERTY(float y READ y WRITE setY DESIGNABLE true USER true)
46  Q_PROPERTY(float z READ z WRITE setZ DESIGNABLE true USER true)
47  Q_PROPERTY(float w READ w WRITE setW DESIGNABLE true USER true)
48 
49  public:
50  QVector4DProperty(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  float w() const;
67  void setW(float w);
68 
69  private:
70  QString parseHints(const QString& hints, const QChar component);
71 
72  Property* m_x;
73  Property* m_y;
74  Property* m_z;
75  Property* m_w;
76  };
77 
78 }
79 #endif //QVECTOR4DPROPERTY_H
Definition: qVector4DProperty.h:41
Definition: apiFunctionsGraph.cpp:39
Definition: Property.h:40
virtual void setValue(const QVariant &value)
Definition: qVector4DProperty.cpp:60
QVariant value(int role=Qt::UserRole) const
Definition: qVector4DProperty.cpp:44
QObject * propertyObject()
Definition: Property.h:77
void setEditorHints(const QString &hints)
Definition: qVector4DProperty.cpp:95