KComposedPropertyInterface Class Referenceabstract

#include <KPropertyFactory.h>

Inherited by KPointComposedProperty, KPointFComposedProperty, KRectComposedProperty, KRectFComposedProperty, KSizeComposedProperty, KSizeFComposedProperty, and KSizePolicyComposedProperty.

Public Member Functions

 KComposedPropertyInterface (KProperty *parent)
bool childValueChangedEnabled () const
void childValueChangedInternal (KProperty *child, const QVariant &value, KProperty::ValueOptions valueOptions)
void setChildValueChangedEnabled (bool set)
virtual void setValue (KProperty *property, const QVariant &value, KProperty::ValueOptions valueOptions)=0
virtual bool valuesEqual (const QVariant &first, const QVariant &second)

Protected Member Functions

virtual void childValueChanged (KProperty *child, const QVariant &value, KProperty::ValueOptions valueOptions)=0
void emitPropertyChanged ()

Detailed Description

An interface for for composed property handlers.

KComposedPropertyInterface should be subclassed to override the behaviour of a property type. In the constructor child property objects should be created if there are any. Then functions handling values should be implemented.

Example implementation of composed properties can be found in editors/ directory.

Definition at line 32 of file KPropertyFactory.h.

Member Function Documentation

void KComposedPropertyInterface::emitPropertyChanged ( )

This method emits the KPropertySet::propertyChanged() signal for all sets our parent-property is registered in.

virtual void KComposedPropertyInterface::setValue ( KProperty property,
const QVariant value,
KProperty::ValueOptions  valueOptions 
pure virtual

This function modifies the child properties for parent value value. It is called by KProperty::setValue() when the property is composed. It is not necessary to modify the property value, it is done by KProperty.

When this method is called valueOptions should have the KProperty::ValueOption::IgnoreComposedProperty flag set or else there will be infinite recursion. The KProperty class makes sure this is the case but developers of custom properties should take special care about this.
virtual bool KComposedPropertyInterface::valuesEqual ( const QVariant first,
const QVariant second 
true if values first and second are equal. Used in KProperty::setValue() to check if value has been changed before setting value. Default implementation uses operator==.

Definition at line 58 of file KPropertyFactory.h.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 23:03:00 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.