RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
Property Class Reference

#include <property.h>

Inheritance diagram for Property:
EnumProperty Vec3fProperty CObjectTypesEnumProperty

Signals

void propertyChanged (QObject *, QString, QVariant, QVariant)
 

Public Member Functions

 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
 

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 enhence the functionality of the QPropertyEditor

Definition at line 36 of file property.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file property.cpp.

Member Function Documentation

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.

Definition at line 71 of file property.cpp.

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.

Definition at line 122 of file property.cpp.

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;")

Definition at line 90 of file property.h.

Property * Property::findPropertyObject ( QObject *  propertyObject)

Tries to find the first property that manages the given propertyObject

Parameters
propertyObject
Returns
Property

Definition at line 139 of file property.cpp.

bool Property::isReadOnly ( )

Flag if the property can be set

Returns
bool true if this property has no set method

Definition at line 61 of file property.cpp.

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

Definition at line 72 of file property.h.

void Property::propertyChanged ( QObject *  ,
QString  ,
QVariant  ,
QVariant   
)
signal
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

Definition at line 66 of file property.h.

int Property::row ( )
inline

Returns the row of this instance within the QPropertyModel

Returns
int row within the QPropertyModel

Definition at line 84 of file property.h.

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.

Definition at line 98 of file property.cpp.

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 Vec3fProperty.

Definition at line 96 of file property.h.

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

Sets the value stored by this property

Parameters
valuethe data converted to a QVariant

Reimplemented in Vec3fProperty.

Definition at line 51 of file property.cpp.

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, CObjectTypesEnumProperty, and Vec3fProperty.

Definition at line 43 of file property.cpp.

Member Data Documentation

QString Property::m_hints
protected

Definition at line 143 of file property.h.

QObject* Property::m_propertyObject
protected

Definition at line 142 of file property.h.


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