itom
Loading...
Searching...
No Matches
qVector2DProperty.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2021, Institut für Technische Optik (ITO),
5 Universität 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 für 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 QVECTOR2DPROPERTY_H
29#define QVECTOR2DPROPERTY_H
30
31#include "Property.h"
32#include <qvariant.h>
33#include <qvector2d.h>
34
35class Property;
36class QObject;
37
38
39namespace ito {
40class QPROPERTYEDITOR_TEST_EXPORT QVector2DProperty : public Property
41{
42 Q_OBJECT
43 Q_PROPERTY(float x READ x WRITE setX DESIGNABLE true USER true)
44 Q_PROPERTY(float y READ y WRITE setY DESIGNABLE true USER true)
45
46public:
48 const QString& name = QString(), QObject* propertyObject = 0, QObject* parent = 0);
49
50 QVariant value(int role = Qt::UserRole) const;
51 virtual void setValue(const QVariant& value);
52
53 void setEditorHints(const QString& hints);
54
55 float x() const;
56 void setX(float x);
57
58 float y() const;
59 void setY(float y);
60
61private:
62 QString parseHints(const QString& hints, const QChar component);
63
64 Property* m_x;
65 Property* m_y;
66};
67
68} // namespace ito
69#endif // QVECTOR2DPROPERTY_H
Definition Property.h:41
Definition qVector2DProperty.h:41
Definition apiFunctionsGraph.cpp:40