lib
KoProperty::CustomProperty Class Reference
#include <customproperty.h>

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.
Public Member Functions | |
CustomProperty (Property *parent) | |
virtual void | setValue (const QVariant &value, bool rememberOldValue)=0 |
virtual QVariant | value () const =0 |
virtual bool | handleValue () const |
Protected Member Functions | |
void | emitPropertyChanged () |
Protected Attributes | |
Property * | m_property |
Member Function Documentation
virtual void KoProperty::CustomProperty::setValue | ( | const QVariant & | value, | |
bool | rememberOldValue | |||
) | [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.
virtual QVariant KoProperty::CustomProperty::value | ( | ) | const [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.
virtual bool KoProperty::CustomProperty::handleValue | ( | ) | const [inline, virtual] |
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.
void CustomProperty::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.
The documentation for this class was generated from the following files: