#include <customproperty.h>
Public Member Functions | |
| CustomProperty (Property *parent) | |
| virtual void | setValue (const TQVariant &value, bool rememberOldValue)=0 |
| virtual TQVariant | value () const =0 |
| virtual bool | handleValue () const |
Protected Member Functions | |
| void | emitPropertyChanged () |
Protected Attributes | |
| Property * | m_property |
Detailed Description
Base class for custom properties.
You will need to subclass CustomProperty to override the behaviour of a property type.
In the constructor, you should create the child properties (if needed). Then, you need to implement the functions concerning values.
Examples of custom properties implementation can be found in customproperty.cpp.
Definition at line 40 of file customproperty.h.
Constructor & Destructor Documentation
◆ CustomProperty()
| CustomProperty::CustomProperty | ( | Property * | parent | ) |
Definition at line 33 of file customproperty.cpp.
◆ ~CustomProperty()
|
virtual |
Definition at line 38 of file customproperty.cpp.
Member Function Documentation
◆ emitPropertyChanged()
|
protected |
This method emits the Set::propertyChanged() signal for all sets our parent-property is registered in.
Definition at line 43 of file customproperty.cpp.
◆ handleValue()
|
inlinevirtual |
Tells whether CustomProperty should be used to get the property's value. CustomProperty::setValue() will always be called. But if hadleValue() == true, then the value stored in the Property won't be changed. You should return true for child properties, and false for others.
Reimplemented in KoProperty::SizeCustomProperty, KoProperty::PointCustomProperty, KoProperty::RectCustomProperty, and KoProperty::SizePolicyCustomProperty.
Definition at line 63 of file customproperty.h.
◆ setValue()
|
pure virtual |
This function is called by Property::setValue() when a custom property is set. You don't have to modify the property value, it is done by Property class. You just have to update child or parent properties value (m_property->parent()->setValue()). Note that, when calling Property::setValue, you need to set useCustomProperty (3rd parameter) to false, or there will be infinite recursion.
Implemented in KoProperty::SizeCustomProperty, KoProperty::PointCustomProperty, KoProperty::RectCustomProperty, and KoProperty::SizePolicyCustomProperty.
◆ value()
|
pure virtual |
This function is called by Property::value() when a custom property is set and handleValue() is true. You should return property's value, taken from parent's value.
Implemented in KoProperty::SizeCustomProperty, KoProperty::PointCustomProperty, KoProperty::RectCustomProperty, and KoProperty::SizePolicyCustomProperty.
Member Data Documentation
◆ m_property
|
protected |
Definition at line 66 of file customproperty.h.
The documentation for this class was generated from the following files:
