Seamly2D
Code documentation
vproperty_p.h
Go to the documentation of this file.
1 /************************************************************************
2  **
3  ** @file vproperty_p.h
4  ** @author hedgeware <internal(at)hedgeware.net>
5  ** @date
6  **
7  ** @brief
8  ** @copyright
9  ** All rights reserved. This program and the accompanying materials
10  ** are made available under the terms of the GNU Lesser General Public License
11  ** (LGPL) version 2.1 which accompanies this distribution, and is available at
12  ** http://www.gnu.org/licenses/lgpl-2.1.html
13  **
14  ** This library is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  ** Lesser General Public License for more details.
18  **
19  *************************************************************************/
20 
21 #ifndef VPROPERTY_P_H
22 #define VPROPERTY_P_H
23 
24 // ONLY INCLUDE THIS IN .CPP FILES
25 
26 #include <QVariant>
27 #include <QString>
28 #include "vproperty.h"
29 
30 namespace VPE
31 {
32 
34 {
35 public:
36  //! The property's value.
37  //! This does not have to be used by subclasses, but it makes sense in cases where QVariant supports
38  //! the data type. Also, this can be used as cache, so that when the data() function gets called by
39  //! the model, the data does not have to be converted in a QVariant every time.
40  QVariant VariantValue;
41 
42  //! Property name
43  QString Name;
44 
45  //! Description
46  QString Description;
47 
48  //! Specifies whether the property is empty or not
49  bool IsEmpty;
50 
51  //! Stores the property type
52  QVariant::Type PropertyVariantType;
53 
54  //! Stores whether the views have to update the parent of this property if it changes
56 
57  //! Stores whether the views have to update the children of this property if it changes
59 
60  //! The parent property
62 
63  QWidget *editor;
64 
66 
67  //! List of child properties
69 
70  //! Constructor passing name and type
71  VPropertyPrivate(const QString &name, QVariant::Type type)
73  , Name(name)
74  , Description(QString())
75  , IsEmpty(false)
77  , updateParent(false)
78  , UpdateChildren(false)
79  , Parent(nullptr)
80  , editor(nullptr)
81  , type(Property::Simple)
82  , Children(QList<VProperty*>())
83  {}
84 
85  //! Constructor
87  : VariantValue()
88  , Name()
89  , Description(QString())
90  , IsEmpty(false)
91  , PropertyVariantType(QVariant::Invalid)
92  , updateParent(false)
93  , UpdateChildren(false)
94  , Parent(nullptr)
95  , editor(nullptr)
96  , type(Property::Simple)
97  , Children(QList<VProperty*>())
98  {}
99 
100  virtual ~VPropertyPrivate();
101 private:
102  Q_DISABLE_COPY(VPropertyPrivate)
103 };
104 
105 }
106 
107 #endif // VPROPERTY_P_H
bool UpdateChildren
Stores whether the views have to update the children of this property if it changes.
Definition: vproperty_p.h:58
QVariant VariantValue
The property's value. This does not have to be used by subclasses, but it makes sense in cases where ...
Definition: vproperty_p.h:40
QVariant::Type PropertyVariantType
Stores the property type.
Definition: vproperty_p.h:52
bool IsEmpty
Specifies whether the property is empty or not.
Definition: vproperty_p.h:49
QString Name
Property name.
Definition: vproperty_p.h:43
bool updateParent
Stores whether the views have to update the parent of this property if it changes.
Definition: vproperty_p.h:55
virtual ~VPropertyPrivate()
Definition: vproperty.cpp:419
VPropertyPrivate()
Constructor.
Definition: vproperty_p.h:86
QString Description
Description.
Definition: vproperty_p.h:46
VProperty * Parent
The parent property.
Definition: vproperty_p.h:61
QList< VProperty * > Children
List of child properties.
Definition: vproperty_p.h:68
VPropertyPrivate(const QString &name, QVariant::Type type)
Constructor passing name and type.
Definition: vproperty_p.h:71
Property
Definition: vproperty.h:43