27 #include "../vproperty_p.h"
49 if (column == DPC_Data && Qt::DisplayRole == role)
59 if (column == DPC_Name || column == DPC_Data)
61 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
64 return Qt::NoItemFlags;
71 if (d_ptr->Children.count() < 2)
76 tempValue.setX(d_ptr->Children.at(0)->getValue().toDouble());
77 tempValue.setY(d_ptr->Children.at(1)->getValue().toDouble());
84 setPointF(point.x(), point.y());
89 if (d_ptr->Children.count() < 2)
95 tempX.convert(QVariant::Double);
98 tempY.convert(QVariant::Double);
100 d_ptr->Children.at(0)->setValue(tempX);
101 d_ptr->Children.at(1)->setValue(tempY);
115 if (!include_children)
118 foreach(
VProperty *tempChild, tempChildren)
131 QPointF tempPoint = value.toPointF();
132 setPointF(tempPoint);
137 QPointF tempValue = getPointF();
138 return QString(
"%1,%2").arg(QString::number(tempValue.x()), QString::number(tempValue.y()));
Class for holding a double property.
virtual QVariant data(int column=DPC_Name, int role=Qt::DisplayRole) const Q_DECL_OVERRIDE
Get the data how it should be displayed.
Qt::ItemFlags flags(int column=DPC_Name) const Q_DECL_OVERRIDE
Returns item flags.
VPointFProperty(const QString &name)
virtual QVariant getValue() const Q_DECL_OVERRIDE
Returns the value of the property as a QVariant.
virtual QString type() const Q_DECL_OVERRIDE
Returns a string containing the type of the property.
virtual QPointF getPointF() const
Returns the QPointF.
virtual void setPointF(const QPointF &point)
Sets the QPointF.
virtual void setValue(const QVariant &value) Q_DECL_OVERRIDE
Sets the value of the property.
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const Q_DECL_OVERRIDE
Clones this property.
QVariant VariantValue
The property's value. This does not have to be used by subclasses, but it makes sense in cases where ...
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const
Clones this property.
virtual void setUpdateBehaviour(bool update_parent, bool update_children)
Sets whether the views should update Parents or children after this property changes.
VPropertyPrivate * d_ptr
The protected structure holding the member variables (to assure binary compatibility)
virtual QVariant data(int column=DPC_Name, int role=Qt::DisplayRole) const
Get the data how it should be displayed.
virtual void removeChild(VProperty *child)
Removes a child from the children list, doesn't delete the child!
virtual int addChild(VProperty *child)
Adds a child to this property.
virtual QList< VProperty * > & getChildren()
Returns a reference to the list of children.