#include <vproperty.h>
Public Types | |
enum | DPC_DisplayColumn { DPC_Name = 0 , DPC_Data } |
Public Slots | |
virtual void | childValueChanged (const QVariant &value, int typeForParent) |
Signals | |
void | childChanged (const QVariant &value, int typeForParent) |
Public Member Functions | |
VProperty (const QString &name, QVariant::Type type=QVariant::String) | |
Standard constructor, takes a name and a parent property as argument. More... | |
virtual | ~VProperty () Q_DECL_OVERRIDE |
Destructor. More... | |
virtual QString | type () const |
Returns a string containing the type of the property. More... | |
virtual QVariant | data (int column=DPC_Name, int role=Qt::DisplayRole) const |
Get the data how it should be displayed. More... | |
virtual bool | setData (const QVariant &data, int role=Qt::EditRole) |
This is used by the model to set the data. More... | |
virtual bool | paint (QPainter *, const QStyleOptionViewItem &, const QModelIndex &, const QAbstractItemDelegate *) const |
This is called by the delegate when the property value is being drawn. The standard implementation doesn't do anything. If you reimplement this in a sub property, make sure to return true or the delegate will draw the item. More... | |
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &, const QAbstractItemDelegate *) |
Returns an editor widget, or NULL if it doesn't supply one. More... | |
virtual bool | setEditorData (QWidget *editor) |
Sets the property's data to the editor (returns false, if the standard delegate should do that) More... | |
virtual QVariant | getEditorData (const QWidget *editor) const |
Gets the data from the widget. More... | |
virtual Qt::ItemFlags | flags (int column=DPC_Name) const |
Returns item flags. More... | |
virtual void | setValue (const QVariant &value) |
Sets the value of the property. More... | |
virtual QVariant | getValue () const |
Returns the value of the property as a QVariant. More... | |
virtual QString | serialize () const |
Serializes the value to a string. More... | |
virtual void | deserialize (const QString &value) |
Deserializes the value from a string. More... | |
virtual void | setName (const QString &name) |
Sets the name of the property. More... | |
virtual QString | getName () const |
Gets the name of the property. More... | |
virtual void | setDescription (const QString &desc) |
Sets the name of the property. More... | |
virtual QString | getDescription () const |
Gets the name of the property. More... | |
virtual int | addChild (VProperty *child) |
Adds a child to this property. More... | |
virtual QList< VProperty * > & | getChildren () |
Returns a reference to the list of children. More... | |
virtual const QList< VProperty * > & | getChildren () const |
Returns a reference to the list of children. More... | |
virtual VProperty * | getChild (int row) const |
Returns the child at a certain row. More... | |
virtual int | getRowCount () const |
Gets the number of children. More... | |
virtual VProperty * | getParent () const |
Gets the parent of this property. More... | |
virtual void | setParent (VProperty *parent) |
Sets the parent of this property. More... | |
virtual void | removeChild (VProperty *child) |
Removes a child from the children list, doesn't delete the child! More... | |
virtual int | getChildRow (VProperty *child) const |
Returns the row the child has. More... | |
virtual bool | getUpdateParent () const |
Returns whether the views have to update the parent of this property if it changes. More... | |
virtual bool | getUpdateChildren () const |
Returns whether the views have to update the children of this property if it changes. More... | |
virtual void | setUpdateBehaviour (bool update_parent, bool update_children) |
Sets whether the views should update Parents or children after this property changes. More... | |
virtual void | setSettings (const QMap< QString, QVariant > &settings) |
Sets the settings by calling the overloaded setSetting(const QString &key, const QVariant &value) for each item in the map. More... | |
virtual QMap< QString, QVariant > | getSettings () const |
Get the settings. More... | |
virtual void | setSetting (const QString &key, const QVariant &value) |
Sets the settings. This function has to be implemented in a subclass in order to have an effect. More... | |
virtual QVariant | getSetting (const QString &key) const |
Get the settings. This function has to be implemented in a subclass in order to have an effect. More... | |
virtual QStringList | getSettingKeys () const |
Returns the list of keys of the property's settings. More... | |
virtual Q_REQUIRED_RESULT VProperty * | clone (bool include_children=true, VProperty *container=nullptr) const |
Clones this property. More... | |
Property | propertyType () const |
void | setPropertyType (const Property &type) |
virtual void | updateParent (const QVariant &value) |
Protected Member Functions | |
VProperty (VPropertyPrivate *d) | |
Protected constructor. More... | |
Protected Attributes | |
VPropertyPrivate * | d_ptr |
The protected structure holding the member variables (to assure binary compatibility) More... | |
Definition at line 56 of file vproperty.h.
Enumerator | |
---|---|
DPC_Name | |
DPC_Data |
Definition at line 60 of file vproperty.h.
|
explicit |
Standard constructor, takes a name and a parent property as argument.
Definition at line 36 of file vproperty.cpp.
Referenced by VFormulaProperty::clone().
|
virtual |
Destructor.
Definition at line 49 of file vproperty.cpp.
|
explicitprotected |
Protected constructor.
Definition at line 43 of file vproperty.cpp.
|
virtual |
Adds a child to this property.
Definition at line 278 of file vproperty.cpp.
References getParent(), and setParent().
Referenced by VPE::VPropertySet::addProperty(), clone(), VPE::QVector3DProperty::QVector3DProperty(), VFormulaProperty::VFormulaProperty(), and VPE::VPointFProperty::VPointFProperty().
|
signal |
Referenced by VPE::VPropertyFormWidget::build().
|
virtualslot |
Definition at line 410 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::build().
|
virtual |
Clones this property.
include_children | Indicates whether to also clone the children |
container | If a property is being passed here, no new VProperty is being created but instead it is tried to fill all the data into container. This can also be used when subclassing this function. |
Reimplemented in VPE::VWidgetProperty, VPE::VStringProperty, VPE::VShortcutProperty, VPE::VPointFProperty, VPE::VObjectProperty, VPE::SpinboxProperty, VPE::LineTypeProperty, VPE::VLineColorProperty, VPE::VLabelProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::VEmptyProperty, VPE::PlainTextProperty, VPE::LineWeightProperty, VPE::QVector3DProperty, VPE::VColorProperty, VPE::VBoolProperty, and VPE::DoubleSpinboxProperty.
Definition at line 372 of file vproperty.cpp.
References addChild(), clone(), setDescription(), setName(), setPropertyType(), setSettings(), setUpdateBehaviour(), and setValue().
Referenced by VPE::VBoolProperty::clone(), VPE::VColorProperty::clone(), VPE::QVector3DProperty::clone(), clone(), VPE::LineWeightProperty::clone(), VPE::PlainTextProperty::clone(), VPE::VEmptyProperty::clone(), VPE::VEnumProperty::clone(), VPE::VFileProperty::clone(), VPE::VLabelProperty::clone(), VPE::VLineColorProperty::clone(), VPE::LineTypeProperty::clone(), VPE::SpinboxProperty::clone(), VPE::VObjectProperty::clone(), VPE::VPointFProperty::clone(), VPE::VShortcutProperty::clone(), VPE::VStringProperty::clone(), VPE::VWidgetProperty::clone(), and VPE::VPropertySet::cloneProperty().
|
virtual |
Returns an editor widget, or NULL if it doesn't supply one.
parent | The widget to which the editor will be added as a child \options Render options \delegate A pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and slots. |
Reimplemented in VPE::VStringProperty, VPE::VShortcutProperty, VPE::VObjectProperty, VPE::SpinboxProperty, VPE::LineTypeProperty, VPE::VLineColorProperty, VPE::VLabelProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::VEmptyProperty, VPE::VColorProperty, VPE::PlainTextProperty, VPE::LineWeightProperty, VFormulaProperty, and VPE::DoubleSpinboxProperty.
Definition at line 105 of file vproperty.cpp.
Referenced by VPE::VPropertyDelegate::createEditor().
|
virtual |
Get the data how it should be displayed.
Reimplemented in VPE::VShortcutProperty, VPE::VPointFProperty, VPE::VObjectProperty, VPE::LineTypeProperty, VPE::VLineColorProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::VEmptyProperty, VPE::QVector3DProperty, VPE::VColorProperty, VPE::VBoolProperty, VPE::LineWeightProperty, and VFormulaProperty.
Definition at line 68 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::commitData(), VPE::VPropertyModel::data(), VPE::LineWeightProperty::data(), VPE::VBoolProperty::data(), VPE::VColorProperty::data(), VPE::QVector3DProperty::data(), VPE::VEmptyProperty::data(), VPE::VEnumProperty::data(), VPE::VFileProperty::data(), VPE::VLineColorProperty::data(), VPE::LineTypeProperty::data(), VPE::VObjectProperty::data(), VPE::VPointFProperty::data(), and VPE::VShortcutProperty::data().
|
virtual |
Deserializes the value from a string.
Definition at line 192 of file vproperty.cpp.
Referenced by VPE::VPropertyFactoryManager::createProperty().
|
virtual |
Returns item flags.
Reimplemented in VPE::VPointFProperty, VPE::VEmptyProperty, VPE::QVector3DProperty, VPE::VBoolProperty, and VFormulaProperty.
Definition at line 156 of file vproperty.cpp.
Referenced by VPE::VPropertyModel::flags(), and VPE::VBoolProperty::flags().
|
virtual |
Returns the child at a certain row.
Definition at line 234 of file vproperty.cpp.
Referenced by VPE::VPropertySet::cloneProperty(), and VPE::VPropertyModel::index().
|
virtual |
Returns a reference to the list of children.
Definition at line 222 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::build(), VPE::QVector3DProperty::clone(), VPE::VPointFProperty::clone(), VPE::VPropertySet::hasProperty(), VPE::VPropertySet::removePropertyFromSet(), and VPE::VPropertyFormWidget::VPropertyFormWidget().
|
virtual |
Returns a reference to the list of children.
Definition at line 228 of file vproperty.cpp.
|
virtual |
Returns the row the child has.
Definition at line 308 of file vproperty.cpp.
Referenced by VPE::VPropertyModel::getIndexFromProperty(), and VPE::VPropertyModel::parent().
|
virtual |
Gets the name of the property.
Definition at line 216 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::buildEditor(), and VPE::VPropertyFormWidget::VPropertyFormWidget().
|
virtual |
Gets the data from the widget.
Reimplemented in VPE::VStringProperty, VPE::VShortcutProperty, VPE::VObjectProperty, VPE::SpinboxProperty, VPE::LineTypeProperty, VPE::VLineColorProperty, VPE::VLabelProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::VEmptyProperty, VPE::VColorProperty, VPE::PlainTextProperty, VPE::LineWeightProperty, VFormulaProperty, and VPE::DoubleSpinboxProperty.
Definition at line 138 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::commitData(), and VPE::VPropertyDelegate::setModelData().
|
virtual |
Gets the name of the property.
Definition at line 204 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::buildEditor(), VFormulaProperty::clone(), and VPE::VPropertyFormWidget::VPropertyFormWidget().
|
virtual |
Gets the parent of this property.
Definition at line 251 of file vproperty.cpp.
Referenced by addChild(), VPE::VPropertySet::addProperty(), VPE::VPropertyFormWidget::commitData(), VPE::VPropertyModel::getIndexFromProperty(), VPE::VPropertySet::getPropertyID(), VPE::VPropertyModel::parent(), removeChild(), and VToolOptionsPropertyBrowser::userChangedData().
|
virtual |
Gets the number of children.
Definition at line 245 of file vproperty.cpp.
Referenced by VPE::VPropertyModel::addProperty(), VPE::VPropertyFormWidget::build(), VPE::VPropertySet::cloneProperty(), and VPE::VPropertyModel::rowCount().
|
virtual |
Get the settings. This function has to be implemented in a subclass in order to have an effect.
Reimplemented in VPE::VStringProperty, VPE::SpinboxProperty, VPE::VLabelProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::PlainTextProperty, and VPE::DoubleSpinboxProperty.
Definition at line 360 of file vproperty.cpp.
Referenced by VPE::DoubleSpinboxProperty::getSetting(), VPE::PlainTextProperty::getSetting(), VPE::VEnumProperty::getSetting(), VPE::VFileProperty::getSetting(), VPE::VLabelProperty::getSetting(), VPE::SpinboxProperty::getSetting(), and VPE::VStringProperty::getSetting().
|
virtual |
Returns the list of keys of the property's settings.
Reimplemented in VPE::VStringProperty, VPE::SpinboxProperty, VPE::VLabelProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::PlainTextProperty, and VPE::DoubleSpinboxProperty.
Definition at line 367 of file vproperty.cpp.
|
virtual |
Get the settings.
Definition at line 342 of file vproperty.cpp.
|
virtual |
Returns whether the views have to update the children of this property if it changes.
Definition at line 320 of file vproperty.cpp.
|
virtual |
Returns whether the views have to update the parent of this property if it changes.
Definition at line 314 of file vproperty.cpp.
Referenced by VPE::VPropertyModel::setData().
|
virtual |
Returns the value of the property as a QVariant.
Reimplemented in VPE::VPointFProperty, VPE::QVector3DProperty, and VFormulaProperty.
Definition at line 181 of file vproperty.cpp.
|
virtual |
This is called by the delegate when the property value is being drawn. The standard implementation doesn't do anything. If you reimplement this in a sub property, make sure to return true or the delegate will draw the item.
Definition at line 98 of file vproperty.cpp.
VPE::Property VPE::VProperty::propertyType | ( | ) | const |
Definition at line 395 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::build(), and VPE::VPropertyFormWidget::commitData().
|
virtual |
Removes a child from the children list, doesn't delete the child!
Removes a child from the children list.
Definition at line 297 of file vproperty.cpp.
References getParent(), and setParent().
Referenced by VPE::QVector3DProperty::clone(), VPE::VPointFProperty::clone(), and setParent().
|
virtual |
Serializes the value to a string.
Definition at line 187 of file vproperty.cpp.
|
virtual |
This is used by the model to set the data.
data | The data to set |
role | The role. Default is Qt::EditRole |
Reimplemented in VPE::VBoolProperty.
Definition at line 86 of file vproperty.cpp.
Referenced by VPE::VPropertyModel::setData().
|
virtual |
Sets the name of the property.
Definition at line 210 of file vproperty.cpp.
Referenced by clone(), and VPE::VPropertyFactoryManager::createProperty().
|
virtual |
Sets the property's data to the editor (returns false, if the standard delegate should do that)
Reimplemented in VPE::VShortcutProperty, VPE::VFileProperty, VPE::VColorProperty, and VFormulaProperty.
Definition at line 117 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::loadData(), and VPE::VPropertyDelegate::setEditorData().
|
virtual |
|
virtual |
Sets the parent of this property.
Definition at line 257 of file vproperty.cpp.
References removeChild().
Referenced by addChild(), removeChild(), and VPE::VPropertySet::removeProperty().
void VPE::VProperty::setPropertyType | ( | const Property & | type | ) |
Definition at line 400 of file vproperty.cpp.
Referenced by clone().
|
virtual |
Sets the settings. This function has to be implemented in a subclass in order to have an effect.
Reimplemented in VPE::VStringProperty, VPE::SpinboxProperty, VPE::VLabelProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::PlainTextProperty, and VPE::DoubleSpinboxProperty.
Definition at line 353 of file vproperty.cpp.
|
virtual |
Sets the settings by calling the overloaded setSetting(const QString &key, const QVariant &value) for each item in the map.
Definition at line 333 of file vproperty.cpp.
Referenced by clone(), VPE::DoubleSpinboxProperty::DoubleSpinboxProperty(), VPE::PlainTextProperty::PlainTextProperty(), VPE::SpinboxProperty::SpinboxProperty(), VPE::VLabelProperty::VLabelProperty(), and VPE::VStringProperty::VStringProperty().
|
virtual |
Sets whether the views should update Parents or children after this property changes.
Definition at line 326 of file vproperty.cpp.
Referenced by clone(), VPE::QVector3DProperty::QVector3DProperty(), VFormulaProperty::VFormulaProperty(), and VPE::VPointFProperty::VPointFProperty().
|
virtual |
Sets the value of the property.
Reimplemented in VPE::VShortcutProperty, VPE::VPointFProperty, VPE::VObjectProperty, VPE::LineTypeProperty, VPE::VLineColorProperty, VPE::VEnumProperty, VPE::QVector3DProperty, VPE::LineWeightProperty, and VFormulaProperty.
Definition at line 171 of file vproperty.cpp.
Referenced by VToolOptionsPropertyBrowser::addPropertyObjectName(), VToolOptionsPropertyBrowser::addPropertyOperationSuffix(), VToolOptionsPropertyBrowser::addPropertyPointName1(), VToolOptionsPropertyBrowser::addPropertyPointName2(), clone(), VPE::VPropertyFormWidget::commitData(), VPE::VPropertyModel::createProperty(), VPE::VShortcutProperty::setValue(), and VToolOptionsPropertyBrowser::showOptionsToolNormal().
|
virtual |
Returns a string containing the type of the property.
Reimplemented in VPE::VWidgetProperty, VPE::VStringProperty, VPE::VShortcutProperty, VPE::VPointFProperty, VPE::VObjectProperty, VPE::SpinboxProperty, VPE::LineTypeProperty, VPE::VLineColorProperty, VPE::VLabelProperty, VPE::VFileProperty, VPE::VEnumProperty, VPE::VEmptyProperty, VPE::QVector3DProperty, VPE::VColorProperty, VPE::VBoolProperty, VPE::PlainTextProperty, VPE::LineWeightProperty, VFormulaProperty, and VPE::DoubleSpinboxProperty.
Definition at line 62 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::build().
|
virtual |
Reimplemented in VPE::VStringProperty, VPE::VLabelProperty, and VPE::PlainTextProperty.
Definition at line 405 of file vproperty.cpp.
Referenced by VPE::VPropertyFormWidget::commitData().
|
protected |
The protected structure holding the member variables (to assure binary compatibility)
Definition at line 214 of file vproperty.h.
Referenced by VPE::DoubleSpinboxProperty::createEditor(), VPE::LineWeightProperty::createEditor(), VPE::VEnumProperty::createEditor(), VPE::VLineColorProperty::createEditor(), VPE::LineTypeProperty::createEditor(), VPE::SpinboxProperty::createEditor(), VPE::VObjectProperty::createEditor(), VPE::LineWeightProperty::currentIndexChanged(), VPE::VEnumProperty::currentIndexChanged(), VPE::VLineColorProperty::currentIndexChanged(), VPE::LineTypeProperty::currentIndexChanged(), VPE::VObjectProperty::currentIndexChanged(), VPE::LineWeightProperty::data(), VPE::VEnumProperty::data(), VPE::VLineColorProperty::data(), VPE::LineTypeProperty::data(), VPE::VObjectProperty::data(), VPE::DoubleSpinboxProperty::DoubleSpinboxProperty(), VPE::LineTypeProperty::LineTypeProperty(), VPE::LineWeightProperty::LineWeightProperty(), VPE::PlainTextProperty::PlainTextProperty(), VFormulaProperty::SetFormula(), VPE::LineWeightProperty::setValue(), VPE::VEnumProperty::setValue(), VPE::VLineColorProperty::setValue(), VPE::LineTypeProperty::setValue(), VPE::VObjectProperty::setValue(), VPE::SpinboxProperty::SpinboxProperty(), VPE::SpinboxProperty::valueChanged(), VPE::VBoolProperty::VBoolProperty(), VPE::VEnumProperty::VEnumProperty(), VFormulaProperty::VFormulaProperty(), VPE::VLabelProperty::VLabelProperty(), VPE::VLineColorProperty::VLineColorProperty(), VPE::VObjectProperty::VObjectProperty(), VPE::VPointFProperty::VPointFProperty(), and VPE::VStringProperty::VStringProperty().