itom
Loading...
Searching...
No Matches
Property Class Reference

#include <Property.h>

Inheritance diagram for Property:
EnumProperty EnumProperty FlagsProperty Vec3fProperty ito::AutoIntervalProperty ito::QVector2DProperty ito::QVector3DProperty ito::QVector4DProperty

Public Member Functions

 Property (const QString &name=QString(), QObject *propertyObject=0, QObject *parent=0)
 
virtual QVariant value (int role=Qt::UserRole) const
 
virtual QString displayValue (int role=Qt::UserRole) const
 
virtual void setValue (const QVariant &value)
 
QObject * propertyObject ()
 
bool isRoot ()
 
bool isReadOnly ()
 
int row ()
 
QString editorHints ()
 
virtual void setEditorHints (const QString &hints)
 
QString info ()
 
virtual void setInfo (const QString &info)
 
bool enabled ()
 
virtual void setEnabled (bool enabled)
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option)
 
virtual QVariant editorData (QWidget *editor)
 
virtual bool setEditorData (QWidget *editor, const QVariant &data)
 
PropertyfindPropertyObject (QObject *propertyObject)
 
 Property (const QString &name=QString(), QObject *propertyObject=0, QObject *parent=0)
 
virtual QVariant value (int role=Qt::UserRole) const
 
virtual void setValue (const QVariant &value)
 
QObject * propertyObject ()
 
bool isRoot ()
 
bool isReadOnly ()
 
int row ()
 
QString editorHints ()
 
virtual void setEditorHints (const QString &hints)
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option)
 
virtual QVariant editorData (QWidget *editor)
 
virtual bool setEditorData (QWidget *editor, const QVariant &data)
 
PropertyfindPropertyObject (QObject *propertyObject)
 

Protected Attributes

QObject * m_propertyObject
 
QString m_hints
 
QString m_info
 
bool m_enabled
 

Private Slots

void setValue (double value)
 
void setValue (int value)
 
void setValue (QColor value)
 
void setValue (bool value)
 
void setValue (QFont value)
 
void setValue (QStringList value)
 
void setValue (double value)
 
void setValue (int value)
 
void setValue (QColor value)
 
void setValue (bool value)
 

Detailed Description

The Property class is the base class for all properties in the QPropertyEditor You can implement custom properties inherited from this class to further enhance the functionality of the QPropertyEditor

Constructor & Destructor Documentation

◆ Property() [1/2]

Property::Property ( const QString & name = QString(),
QObject * propertyObject = 0,
QObject * parent = 0 )

Constructor

Parameters
namethe name of the property within the propertyObject (will be used in the QPropertyEditorWidget view too)
propertyObjectthe object that contains the property
parentoptional parent object

◆ Property() [2/2]

Property::Property ( const QString & name = QString(),
QObject * propertyObject = 0,
QObject * parent = 0 )

Constructor

Parameters
namethe name of the property within the propertyObject (will be used in the QPropertyEditorWidget view too)
propertyObjectthe object that contains the property
parentoptional parent object

Member Function Documentation

◆ createEditor() [1/2]

QWidget * Property::createEditor ( QWidget * parent,
const QStyleOptionViewItem & option )
virtual

Creates an editor for the data managed by this instance

Parameters
parentwidget the newly created editor widget will be child of
optioncurrently not used
Returns
QWidget* pointer to the editor widget

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

◆ createEditor() [2/2]

virtual QWidget * Property::createEditor ( QWidget * parent,
const QStyleOptionViewItem & option )
virtual

Creates an editor for the data managed by this instance

Parameters
parentwidget the newly created editor widget will be child of
optioncurrently not used
Returns
QWidget* pointer to the editor widget

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

◆ displayValue()

QString Property::displayValue ( int role = Qt::UserRole) const
virtual

The value stored by this property

Returns
QString the data converted to a readable string

◆ editorData() [1/2]

QVariant Property::editorData ( QWidget * editor)
virtual

Returns the data of the editor widget used to manipulate this instance

Returns
QVariant the data converted to a QVariant

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

◆ editorData() [2/2]

virtual QVariant Property::editorData ( QWidget * editor)
virtual

Returns the data of the editor widget used to manipulate this instance

Returns
QVariant the data converted to a QVariant

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

◆ editorHints() [1/2]

QString Property::editorHints ( )
inline

returns optional settings for the editor widget that is used to manipulate the properties value

Returns
QString a string that contains property settings for the editor widget (e.g. "minimum=1.0;maximum=10.0;")

◆ editorHints() [2/2]

QString Property::editorHints ( )
inline

returns optional settings for the editor widget that is used to manipulate the properties value

Returns
QString a string that contains property settings for the editor widget (e.g. "minimum=1.0;maximum=10.0;")

◆ findPropertyObject() [1/2]

Property * Property::findPropertyObject ( QObject * propertyObject)

Tries to find the first property that manages the given propertyObject

Parameters
propertyObject
Returns
Property

◆ findPropertyObject() [2/2]

Property * Property::findPropertyObject ( QObject * propertyObject)

Tries to find the first property that manages the given propertyObject

Parameters
propertyObject
Returns
Property

◆ isReadOnly() [1/2]

bool Property::isReadOnly ( )

Flag if the property can be set

Returns
bool true if this property has no set method

◆ isReadOnly() [2/2]

bool Property::isReadOnly ( )

Flag if the property can be set

Returns
bool true if this property has no set method

◆ isRoot() [1/2]

bool Property::isRoot ( )
inline

Flag if property is used for indicating a group or really manages a property

Returns
bool true if this property is only used to display a category in the QPropertyEditorWidget

◆ isRoot() [2/2]

bool Property::isRoot ( )
inline

Flag if property is used for indicating a group or really manages a property

Returns
bool true if this property is only used to display a category in the QPropertyEditorWidget

◆ propertyObject() [1/2]

QObject * Property::propertyObject ( )
inline

Returns the QObject which contains the property managed by this instance

Returns
QObject* pointer to the QObject that contains user defined properties

◆ propertyObject() [2/2]

QObject * Property::propertyObject ( )
inline

Returns the QObject which contains the property managed by this instance

Returns
QObject* pointer to the QObject that contains user defined properties

◆ row() [1/2]

int Property::row ( )
inline

Returns the row of this instance within the QPropertyModel

Returns
int row within the QPropertyModel

◆ row() [2/2]

int Property::row ( )
inline

Returns the row of this instance within the QPropertyModel

Returns
int row within the QPropertyModel

◆ setEditorData() [1/2]

bool Property::setEditorData ( QWidget * editor,
const QVariant & data )
virtual

Changes the editor widget's data to a specific value

Parameters
editorthe editor widget
datathe data to set in the editor widget
Returns
bool true if editor widget was set to the given data successfully, false if the data can not be set in the editor (e.g. wrong datatype)

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

◆ setEditorData() [2/2]

virtual bool Property::setEditorData ( QWidget * editor,
const QVariant & data )
virtual

Changes the editor widget's data to a specific value

Parameters
editorthe editor widget
datathe data to set in the editor widget
Returns
bool true if editor widget was set to the given data successfully, false if the data can not be set in the editor (e.g. wrong datatype)

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

◆ setEditorHints() [1/2]

virtual void Property::setEditorHints ( const QString & hints)
inlinevirtual

Sets properties for the editor widget that is used to manipulate the data value managed by this instance

Parameters
hintsa string containing property settings for the editor widget that manipulates this property

Reimplemented in ito::AutoIntervalProperty, ito::QVector2DProperty, ito::QVector3DProperty, ito::QVector4DProperty, and Vec3fProperty.

◆ setEditorHints() [2/2]

virtual void Property::setEditorHints ( const QString & hints)
inlinevirtual

Sets properties for the editor widget that is used to manipulate the data value managed by this instance

Parameters
hintsa string containing property settings for the editor widget that manipulates this property

Reimplemented in ito::AutoIntervalProperty, ito::QVector2DProperty, ito::QVector3DProperty, ito::QVector4DProperty, and Vec3fProperty.

◆ setValue() [1/6]

void Property::setValue ( const QVariant & value)
virtual

Sets the value stored by this property

Parameters
valuethe data converted to a QVariant

Reimplemented in ito::AutoIntervalProperty, ito::QVector2DProperty, ito::QVector3DProperty, ito::QVector4DProperty, and Vec3fProperty.

◆ setValue() [2/6]

virtual void Property::setValue ( const QVariant & value)
virtual

Sets the value stored by this property

Parameters
valuethe data converted to a QVariant

Reimplemented in ito::AutoIntervalProperty, ito::QVector2DProperty, ito::QVector3DProperty, ito::QVector4DProperty, and Vec3fProperty.

◆ setValue [3/6]

void Property::setValue ( double value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of a double or float property has changed

Parameters
valuethe new value

◆ setValue [4/6]

void Property::setValue ( double value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of a double or float property has changed

Parameters
valuethe new value

◆ setValue [5/6]

void Property::setValue ( int value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of an integer property has changed

Parameters
valuethe new value

◆ setValue [6/6]

void Property::setValue ( int value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of an integer property has changed

Parameters
valuethe new value

◆ value() [1/2]

QVariant Property::value ( int role = Qt::UserRole) const
virtual

The value stored by this property

Returns
QVariant the data converted to a QVariant

Reimplemented in EnumProperty, EnumProperty, FlagsProperty, ito::AutoIntervalProperty, ito::QVector2DProperty, ito::QVector3DProperty, ito::QVector4DProperty, and Vec3fProperty.

◆ value() [2/2]

virtual QVariant Property::value ( int role = Qt::UserRole) const
virtual

The value stored by this property

Returns
QVariant the data converted to a QVariant

Reimplemented in EnumProperty, EnumProperty, FlagsProperty, ito::AutoIntervalProperty, ito::QVector2DProperty, ito::QVector3DProperty, ito::QVector4DProperty, and Vec3fProperty.


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