KComposedPropertyInterface

Search for usage in LXR

KComposedPropertyInterface Class Referenceabstract

#include <KPropertyFactory.h>

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.

Constructor & Destructor Documentation

◆ KComposedPropertyInterface()

KComposedPropertyInterface::KComposedPropertyInterface ( KProperty * parent)
explicit

Definition at line 286 of file KPropertyFactory.cpp.

◆ ~KComposedPropertyInterface()

KComposedPropertyInterface::~KComposedPropertyInterface ( )
virtual

Definition at line 292 of file KPropertyFactory.cpp.

Member Function Documentation

◆ childValueChangedEnabled()

bool KComposedPropertyInterface::childValueChangedEnabled ( ) const

Definition at line 310 of file KPropertyFactory.cpp.

◆ childValueChangedInternal()

void KComposedPropertyInterface::childValueChangedInternal ( KProperty * child,
const QVariant & value,
KProperty::ValueOptions valueOptions )

Definition at line 297 of file KPropertyFactory.cpp.

◆ emitPropertyChanged()

void KComposedPropertyInterface::emitPropertyChanged ( )
protected

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

◆ setChildValueChangedEnabled()

void KComposedPropertyInterface::setChildValueChangedEnabled ( bool set)

Definition at line 305 of file KPropertyFactory.cpp.

◆ setValue()

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.

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

◆ valuesEqual()

virtual bool KComposedPropertyInterface::valuesEqual ( const QVariant & first,
const QVariant & second )
inlinevirtual
Returns
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-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:57:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.