Seamly2D
Code documentation
VPE::VObjectProperty Class Reference

#include <vobjectproperty.h>

Inheritance diagram for VPE::VObjectProperty:
Collaboration diagram for VPE::VObjectProperty:

Public Slots

void currentIndexChanged (int index)
 
- Public Slots inherited from VPE::VProperty
virtual void childValueChanged (const QVariant &value, int typeForParent)
 

Public Member Functions

 VObjectProperty (const QString &name)
 Constructor. More...
 
virtual ~VObjectProperty () Q_DECL_OVERRIDE
 Destructor. More...
 
virtual QVariant data (int column=DPC_Name, int role=Qt::DisplayRole) const Q_DECL_OVERRIDE
 Get the data how it should be displayed. More...
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) Q_DECL_OVERRIDE
 Returns an editor widget, or NULL if it doesn't supply one. More...
 
virtual QVariant getEditorData (const QWidget *editor) const Q_DECL_OVERRIDE
 Gets the data from the widget. More...
 
void setObjectsList (const QMap< QString, quint32 > &objects)
 Sets the objects list. More...
 
virtual QMap< QString, quint32 > getObjects () const
 Get the settings. This function has to be implemented in a subclass in order to have an effect. More...
 
virtual void setValue (const QVariant &value) Q_DECL_OVERRIDE
 Sets the value of the property. More...
 
virtual QString type () const Q_DECL_OVERRIDE
 Returns a string containing the type of the property. More...
 
virtual Q_REQUIRED_RESULT VPropertyclone (bool include_children=true, VProperty *container=nullptr) const Q_DECL_OVERRIDE
 Clones this property. More...
 
- Public Member Functions inherited from VPE::VProperty
 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 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 bool setEditorData (QWidget *editor)
 Sets the property's data to the editor (returns false, if the standard delegate should do that) More...
 
virtual Qt::ItemFlags flags (int column=DPC_Name) const
 Returns item flags. 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 VPropertygetChild (int row) const
 Returns the child at a certain row. More...
 
virtual int getRowCount () const
 Gets the number of children. More...
 
virtual VPropertygetParent () 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...
 
Property propertyType () const
 
void setPropertyType (const Property &type)
 
virtual void updateParent (const QVariant &value)
 

Static Public Member Functions

static int indexOfObject (const QMap< QString, quint32 > &objects, const QString &object)
 

Protected Member Functions

void fillListItems (QComboBox *box, const QMap< QString, quint32 > &list) const
 
- Protected Member Functions inherited from VPE::VProperty
 VProperty (VPropertyPrivate *d)
 Protected constructor. More...
 

Protected Attributes

QMap< QString, quint32 > m_objects
 The list of possible objects. More...
 
QVector< QString > m_indexList
 
- Protected Attributes inherited from VPE::VProperty
VPropertyPrivated_ptr
 The protected structure holding the member variables (to assure binary compatibility) More...
 

Additional Inherited Members

- Public Types inherited from VPE::VProperty
enum  DPC_DisplayColumn { DPC_Name = 0 , DPC_Data }
 
- Signals inherited from VPE::VProperty
void childChanged (const QVariant &value, int typeForParent)
 

Detailed Description

Definition at line 49 of file vobjectproperty.h.

Constructor & Destructor Documentation

◆ VObjectProperty()

VPE::VObjectProperty::VObjectProperty ( const QString &  name)
explicit

Constructor.

Definition at line 37 of file vobjectproperty.cpp.

References VPE::VProperty::d_ptr, and VPE::VPropertyPrivate::VariantValue.

◆ ~VObjectProperty()

virtual VPE::VObjectProperty::~VObjectProperty ( )
inlinevirtual

Destructor.

Definition at line 57 of file vobjectproperty.h.

Member Function Documentation

◆ clone()

VPE::VProperty * VPE::VObjectProperty::clone ( bool  include_children = true,
VProperty container = nullptr 
) const
virtual

Clones this property.

Parameters
include_childrenIndicates whether to also clone the children
containerIf 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.
Returns
Returns the newly created property (or container, if it was not NULL)

Reimplemented from VPE::VProperty.

Definition at line 152 of file vobjectproperty.cpp.

References VPE::VProperty::clone().

◆ createEditor()

QWidget * VPE::VObjectProperty::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  options,
const QAbstractItemDelegate *  delegate 
)
virtual

Returns an editor widget, or NULL if it doesn't supply one.

Parameters
parentThe 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 from VPE::VProperty.

Definition at line 76 of file vobjectproperty.cpp.

References currentIndexChanged(), VPE::VProperty::d_ptr, and VPE::VPropertyPrivate::editor.

◆ currentIndexChanged

void VPE::VObjectProperty::currentIndexChanged ( int  index)
slot

Definition at line 169 of file vobjectproperty.cpp.

References VPE::VProperty::d_ptr.

Referenced by createEditor().

◆ data()

QVariant VPE::VObjectProperty::data ( int  column = DPC_Name,
int  role = Qt::DisplayRole 
) const
virtual

Get the data how it should be displayed.

Reimplemented from VPE::VProperty.

Definition at line 47 of file vobjectproperty.cpp.

References VPE::VProperty::d_ptr, VPE::VProperty::data(), and VPE::VPropertyPrivate::VariantValue.

◆ fillListItems()

void VPE::VObjectProperty::fillListItems ( QComboBox *  box,
const QMap< QString, quint32 > &  list 
) const
protected

Definition at line 176 of file vobjectproperty.cpp.

◆ getEditorData()

QVariant VPE::VObjectProperty::getEditorData ( const QWidget *  editor) const
virtual

Gets the data from the widget.

Reimplemented from VPE::VProperty.

Definition at line 95 of file vobjectproperty.cpp.

◆ getObjects()

QMap< QString, quint32 > VPE::VObjectProperty::getObjects ( ) const
virtual

Get the settings. This function has to be implemented in a subclass in order to have an effect.

Definition at line 123 of file vobjectproperty.cpp.

◆ indexOfObject()

int VPE::VObjectProperty::indexOfObject ( const QMap< QString, quint32 > &  objects,
const QString &  object 
)
static

Definition at line 157 of file vobjectproperty.cpp.

Referenced by VToolOptionsPropertyBrowser::addObjectProperty(), VToolOptionsPropertyBrowser::updateOptionsToolAlongLine(), VToolOptionsPropertyBrowser::updateOptionsToolArc(), VToolOptionsPropertyBrowser::updateOptionsToolArcWithLength(), VToolOptionsPropertyBrowser::updateOptionsToolBisector(), VToolOptionsPropertyBrowser::updateOptionsToolCubicBezier(), VToolOptionsPropertyBrowser::updateOptionsToolCurveIntersectAxis(), VToolOptionsPropertyBrowser::updateOptionsToolCutArc(), VToolOptionsPropertyBrowser::updateOptionsToolCutSpline(), VToolOptionsPropertyBrowser::updateOptionsToolCutSplinePath(), VToolOptionsPropertyBrowser::updateOptionsToolEllipticalArc(), VToolOptionsPropertyBrowser::updateOptionsToolEndLine(), VToolOptionsPropertyBrowser::updateOptionsToolHeight(), VToolOptionsPropertyBrowser::updateOptionsToolLine(), VToolOptionsPropertyBrowser::updateOptionsToolLineIntersect(), VToolOptionsPropertyBrowser::updateOptionsToolLineIntersectAxis(), VToolOptionsPropertyBrowser::updateOptionsToolMirrorByAxis(), VToolOptionsPropertyBrowser::updateOptionsToolMirrorByLine(), VToolOptionsPropertyBrowser::updateOptionsToolMove(), VToolOptionsPropertyBrowser::updateOptionsToolNormal(), VToolOptionsPropertyBrowser::updateOptionsToolPointFromArcAndTangent(), VToolOptionsPropertyBrowser::updateOptionsToolPointFromCircleAndTangent(), VToolOptionsPropertyBrowser::updateOptionsToolPointOfContact(), VToolOptionsPropertyBrowser::updateOptionsToolPointOfIntersection(), VToolOptionsPropertyBrowser::updateOptionsToolPointOfIntersectionArcs(), VToolOptionsPropertyBrowser::updateOptionsToolPointOfIntersectionCircles(), VToolOptionsPropertyBrowser::updateOptionsToolPointOfIntersectionCurves(), VToolOptionsPropertyBrowser::updateOptionsToolRotation(), VToolOptionsPropertyBrowser::updateOptionsToolShoulderPoint(), VToolOptionsPropertyBrowser::updateOptionsToolSpline(), VToolOptionsPropertyBrowser::updateOptionsToolTriangle(), and VToolOptionsPropertyBrowser::updateOptionsToolTrueDarts().

◆ setObjectsList()

void VPE::VObjectProperty::setObjectsList ( const QMap< QString, quint32 > &  objects)

Sets the objects list.

Definition at line 108 of file vobjectproperty.cpp.

Referenced by VToolOptionsPropertyBrowser::addObjectProperty().

◆ setValue()

void VPE::VObjectProperty::setValue ( const QVariant &  value)
virtual

Sets the value of the property.

Reimplemented from VPE::VProperty.

Definition at line 129 of file vobjectproperty.cpp.

References VPE::VProperty::d_ptr, and VPE::VPropertyPrivate::VariantValue.

Referenced by VToolOptionsPropertyBrowser::addObjectProperty().

◆ type()

QString VPE::VObjectProperty::type ( ) const
virtual

Returns a string containing the type of the property.

Reimplemented from VPE::VProperty.

Definition at line 147 of file vobjectproperty.cpp.

Member Data Documentation

◆ m_indexList

QVector<QString> VPE::VObjectProperty::m_indexList
protected

Definition at line 101 of file vobjectproperty.h.

◆ m_objects

QMap<QString, quint32> VPE::VObjectProperty::m_objects
protected

The list of possible objects.

Definition at line 100 of file vobjectproperty.h.


The documentation for this class was generated from the following files: