Seamly2D
Code documentation
VPE::PlainTextProperty Class Reference

Class for holding a plain text property. More...

#include <plaintext_property.h>

Inheritance diagram for VPE::PlainTextProperty:
Collaboration diagram for VPE::PlainTextProperty:

Public Member Functions

 PlainTextProperty (const QString &name, const QMap< QString, QVariant > &settings)
 
 PlainTextProperty (const QString &name)
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) Q_DECL_OVERRIDE
 createEditor Returns an editor widget, or NULL if it doesn't supply one More...
 
virtual QVariant getEditorData (const QWidget *editor) const Q_DECL_OVERRIDE
 getEditorData Gets the data from the widget @oaram editor More...
 
void setReadOnly (bool readOnly)
 
void setOsSeparator (bool separator)
 
void setClearButtonEnable (bool value)
 
virtual void setSetting (const QString &key, const QVariant &value) Q_DECL_OVERRIDE
 setSetting Sets the settings. More...
 
virtual QVariant getSetting (const QString &key) const Q_DECL_OVERRIDE
 getSetting Gets the settings.his function has to be implemented in a subclass in order to have an effect. More...
 
virtual QStringList getSettingKeys () const Q_DECL_OVERRIDE
 getSettingKeys Returns the list of keys of the property's settings. More...
 
virtual QString type () const Q_DECL_OVERRIDE
 type 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
 clone Clones this property More...
 
virtual void updateParent (const QVariant &value) Q_DECL_OVERRIDE
 
int getTypeForParent () const
 
void setTypeForParent (int value)
 
- 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 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 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 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 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...
 
Property propertyType () const
 
void setPropertyType (const Property &type)
 

Protected Member Functions

virtual bool eventFilter (QObject *object, QEvent *event) Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VPE::VProperty
 VProperty (VPropertyPrivate *d)
 Protected constructor. More...
 

Protected Attributes

bool m_readOnly
 
int m_typeForParent
 
bool m_osSeparator
 
- 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 }
 
- Public Slots inherited from VPE::VProperty
virtual void childValueChanged (const QVariant &value, int typeForParent)
 
- Signals inherited from VPE::VProperty
void childChanged (const QVariant &value, int typeForParent)
 

Detailed Description

Class for holding a plain text property.

Definition at line 49 of file plaintext_property.h.

Constructor & Destructor Documentation

◆ PlainTextProperty() [1/2]

VPE::PlainTextProperty::PlainTextProperty ( const QString &  name,
const QMap< QString, QVariant > &  settings 
)

◆ PlainTextProperty() [2/2]

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

Member Function Documentation

◆ clone()

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

clone 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 173 of file plaintext_property.cpp.

References VPE::VProperty::clone().

◆ createEditor()

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

createEditor 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
optionsRender options
delegateA pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and slots.

Reimplemented from VPE::VProperty.

Definition at line 72 of file plaintext_property.cpp.

◆ eventFilter()

bool VPE::PlainTextProperty::eventFilter ( QObject *  object,
QEvent *  event 
)
protectedvirtual

Definition at line 194 of file plaintext_property.cpp.

◆ getEditorData()

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

getEditorData Gets the data from the widget @oaram editor

Reimplemented from VPE::VProperty.

Definition at line 95 of file plaintext_property.cpp.

◆ getSetting()

QVariant VPE::PlainTextProperty::getSetting ( const QString &  key) const
virtual

getSetting Gets the settings.his function has to be implemented in a subclass in order to have an effect.

Reimplemented from VPE::VProperty.

Definition at line 134 of file plaintext_property.cpp.

References VPE::VProperty::getSetting().

◆ getSettingKeys()

QStringList VPE::PlainTextProperty::getSettingKeys ( ) const
virtual

getSettingKeys Returns the list of keys of the property's settings.

Reimplemented from VPE::VProperty.

Definition at line 151 of file plaintext_property.cpp.

◆ getTypeForParent()

int VPE::PlainTextProperty::getTypeForParent ( ) const

Definition at line 184 of file plaintext_property.cpp.

◆ setClearButtonEnable()

void VPE::PlainTextProperty::setClearButtonEnable ( bool  value)

◆ setOsSeparator()

void VPE::PlainTextProperty::setOsSeparator ( bool  separator)

Definition at line 111 of file plaintext_property.cpp.

Referenced by VFormulaProperty::VFormulaProperty().

◆ setReadOnly()

void VPE::PlainTextProperty::setReadOnly ( bool  readOnly)

Definition at line 106 of file plaintext_property.cpp.

◆ setSetting()

void VPE::PlainTextProperty::setSetting ( const QString &  key,
const QVariant &  value 
)
virtual

setSetting Sets the settings.

Reimplemented from VPE::VProperty.

Definition at line 119 of file plaintext_property.cpp.

◆ setTypeForParent()

void VPE::PlainTextProperty::setTypeForParent ( int  value)

Definition at line 189 of file plaintext_property.cpp.

◆ type()

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

type Returns a string containing the type of the property.

Reimplemented from VPE::VProperty.

Definition at line 161 of file plaintext_property.cpp.

◆ updateParent()

void VPE::PlainTextProperty::updateParent ( const QVariant &  value)
virtual

Reimplemented from VPE::VProperty.

Definition at line 178 of file plaintext_property.cpp.

Member Data Documentation

◆ m_osSeparator

bool VPE::PlainTextProperty::m_osSeparator
protected

Definition at line 85 of file plaintext_property.h.

◆ m_readOnly

bool VPE::PlainTextProperty::m_readOnly
protected

Definition at line 83 of file plaintext_property.h.

◆ m_typeForParent

int VPE::PlainTextProperty::m_typeForParent
protected

Definition at line 84 of file plaintext_property.h.


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