KDevelop API Documentation

PropertyLib::MultiProperty Class Reference

Holds a list of properties with the same name and type. More...

#include <multiproperty.h>

Collaboration diagram for PropertyLib::MultiProperty:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MultiProperty (Property *prop)
 Constructs multiproperty with one property which is not connected to a property list.
 MultiProperty (PropertyList *propertyList)
 Constructs empty multiproperty.
 MultiProperty (PropertyList *propertyList, Property *prop)
 Constructs multiproperty with one Property in the list.
 ~MultiProperty ()
bool operator== (const MultiProperty &prop) const
 Compares two multiproperties.
bool operator== (const Property &prop) const
 Compares multiproperty with property.
void addProperty (Property *prop)
 Adds property to the list.
void removeProperty (Property *prop)
 Removes property from the list.
void addProperty (MultiProperty *prop)
 Adds all properties from the multiproperty prop.
void removeProperty (MultiProperty *prop)
 Removes all properties that exists in the multiproperty prop.
QString name () const
 Returns the name of a property.
int type () const
 Returns the type of a property.
QVariant value () const
 Returns the value of a property.
QString description () const
 Returns the description of a property.
bool readOnly () const
 Returns the readonly attribute of a property.
bool visible () const
 Returns the visibility attribute of a property.
QMap< QString, QVariantvalueList () const
 The string-to-value correspondence list of the property.
void setValue (const QVariant &value)
 Sets the value of a property.
void setValue (const QVariant &value, bool emitChange)
 Sets the value of a property.
void setDescription (const QString &description)
 Sets the description of a property.
void setValueList (const QMap< QString, QVariant > &valueList)
 Sets the list of possible values of a property.
QVariant findValueDescription () const
 Finds string description for a value.
QVariant findValueDescription (QVariant val) const
 Finds string description for a value.
bool valid () const
 Returns true if the multiproperty has no properties in the list (i.e.
void undo ()
 Reverts the property value to previous setting.

Public Attributes

QValueList< ChildPropertydetails
 The list of child properties.

Private Attributes

QPtrList< Propertylist
PropertyListm_propertyList

Friends

class PropertyList
class PropertyBuffer

Detailed Description

Holds a list of properties with the same name and type.

It is used by PropertyList to store properties. Generally, PropertyList stores a list of multiproperties instead of properties. This allows working with many properties of the same name and type at the same type.

MultiProperty is also responsible for storing detailed property editors (instances of ChildProperty class. It's too much overhead to store child properties with their parent properties. MultiProperty provides a way to store child properties only once for all properties with the same name and same type.

Definition at line 49 of file multiproperty.h.


Constructor & Destructor Documentation

PropertyLib::MultiProperty::MultiProperty Property prop  ) 
 

Constructs multiproperty with one property which is not connected to a property list.

Definition at line 25 of file multiproperty.cpp.

References list.

PropertyLib::MultiProperty::MultiProperty PropertyList propertyList  ) 
 

Constructs empty multiproperty.

Definition at line 31 of file multiproperty.cpp.

PropertyLib::MultiProperty::MultiProperty PropertyList propertyList,
Property prop
 

Constructs multiproperty with one Property in the list.

Definition at line 36 of file multiproperty.cpp.

References list.

PropertyLib::MultiProperty::~MultiProperty  ) 
 

Definition at line 42 of file multiproperty.cpp.


Member Function Documentation

void PropertyLib::MultiProperty::addProperty MultiProperty prop  ) 
 

Adds all properties from the multiproperty prop.

Definition at line 213 of file multiproperty.cpp.

References addProperty(), and list.

void PropertyLib::MultiProperty::addProperty Property prop  ) 
 

Adds property to the list.

Definition at line 183 of file multiproperty.cpp.

References list.

Referenced by PropertyLib::PropertyList::addProperty(), and addProperty().

QString PropertyLib::MultiProperty::description  )  const
 

Returns the description of a property.

Definition at line 78 of file multiproperty.cpp.

References PropertyLib::Property::description(), and list.

QVariant PropertyLib::MultiProperty::findValueDescription QVariant  val  )  const
 

Finds string description for a value.

Definition at line 241 of file multiproperty.cpp.

References type(), and valueList().

QVariant PropertyLib::MultiProperty::findValueDescription  )  const
 

Finds string description for a value.

Definition at line 227 of file multiproperty.cpp.

References type(), value(), and valueList().

QString PropertyLib::MultiProperty::name  )  const
 

Returns the name of a property.

Definition at line 46 of file multiproperty.cpp.

References list.

Referenced by PropertyLib::PropertyList::addToGroup(), PropertyLib::PropertyEditor::machine(), PropertyLib::PropertyMachineFactory::machineForProperty(), operator==(), PropertyLib::PropertyEditor::propertyChanged(), PropertyLib::PropertyWidget::propertyName(), and PropertyLib::PropertyList::removeFromGroup().

bool PropertyLib::MultiProperty::operator== const Property prop  )  const
 

Compares multiproperty with property.

Definition at line 204 of file multiproperty.cpp.

References PropertyLib::Property::name(), name(), PropertyLib::Property::type(), and type().

bool PropertyLib::MultiProperty::operator== const MultiProperty prop  )  const
 

Compares two multiproperties.

Definition at line 197 of file multiproperty.cpp.

References name(), and type().

bool PropertyLib::MultiProperty::readOnly  )  const
 

Returns the readonly attribute of a property.

Definition at line 96 of file multiproperty.cpp.

References list, and PropertyLib::Property::readOnly().

void PropertyLib::MultiProperty::removeProperty MultiProperty prop  ) 
 

Removes all properties that exists in the multiproperty prop.

Definition at line 220 of file multiproperty.cpp.

References list, and removeProperty().

void PropertyLib::MultiProperty::removeProperty Property prop  ) 
 

Removes property from the list.

Definition at line 188 of file multiproperty.cpp.

References list.

Referenced by PropertyLib::PropertyList::removeProperty(), and removeProperty().

void PropertyLib::MultiProperty::setDescription const QString description  ) 
 

Sets the description of a property.

Definition at line 139 of file multiproperty.cpp.

References list, and PropertyLib::Property::setDescription().

void PropertyLib::MultiProperty::setValue const QVariant value,
bool  emitChange
 

Sets the value of a property.

Parameters:
emitChange if set to true then property list which owns this multiproperty emits propertyValueChanged signal.

Definition at line 165 of file multiproperty.cpp.

References list, m_propertyList, PropertyLib::PropertyList::propertyValueChanged(), and PropertyLib::Property::setValue().

void PropertyLib::MultiProperty::setValue const QVariant value  ) 
 

Sets the value of a property.

Definition at line 154 of file multiproperty.cpp.

References list, m_propertyList, PropertyLib::PropertyList::propertyValueChanged(), and PropertyLib::Property::setValue().

Referenced by PropertyLib::PropertyEditor::propertyChanged(), and PropertyLib::ChildProperty::setValue().

void PropertyLib::MultiProperty::setValueList const QMap< QString, QVariant > &  valueList  ) 
 

Sets the list of possible values of a property.

Definition at line 176 of file multiproperty.cpp.

References list, and PropertyLib::Property::setValueList().

int PropertyLib::MultiProperty::type  )  const
 

Returns the type of a property.

Definition at line 53 of file multiproperty.cpp.

References list.

Referenced by PropertyLib::PropertyEditor::addChildProperties(), findValueDescription(), PropertyLib::PropertyEditor::machine(), PropertyLib::PropertyMachineFactory::machineForProperty(), operator==(), PropertyLib::PropertyEditor::prepareEditor(), PropertyLib::ChildProperty::setValue(), and PropertyLib::ChildProperty::value().

void PropertyLib::MultiProperty::undo  ) 
 

Reverts the property value to previous setting.

Definition at line 259 of file multiproperty.cpp.

References list, m_propertyList, PropertyLib::Property::oldValue(), PropertyLib::PropertyList::propertyValueChanged(), and PropertyLib::Property::setValue().

Referenced by PropertyLib::PropertyWidget::undo().

bool PropertyLib::MultiProperty::valid  )  const
 

Returns true if the multiproperty has no properties in the list (i.e.

it's invalid).

Definition at line 254 of file multiproperty.cpp.

References list.

Referenced by PropertyLib::ChildProperty::setValue(), and PropertyLib::ChildProperty::value().

QVariant PropertyLib::MultiProperty::value  )  const
 

Returns the value of a property.

Definition at line 60 of file multiproperty.cpp.

References list, and PropertyLib::Property::value().

Referenced by findValueDescription(), PropertyLib::PropertyEditor::prepareEditor(), PropertyLib::ChildProperty::setValue(), and PropertyLib::ChildProperty::value().

QMap< QString, QVariant > PropertyLib::MultiProperty::valueList  )  const
 

The string-to-value correspondence list of the property.

Definition at line 132 of file multiproperty.cpp.

References list.

Referenced by findValueDescription(), PropertyLib::PropertyEditor::machine(), PropertyLib::PropertyMachineFactory::machineForProperty(), and PropertyLib::PropertyEditor::prepareEditor().

bool PropertyLib::MultiProperty::visible  )  const
 

Returns the visibility attribute of a property.

Definition at line 114 of file multiproperty.cpp.

References list, and PropertyLib::Property::visible().


Friends And Related Function Documentation

friend class PropertyBuffer [friend]
 

Definition at line 120 of file multiproperty.h.

friend class PropertyList [friend]
 

Definition at line 119 of file multiproperty.h.


Member Data Documentation

QValueList<ChildProperty> PropertyLib::MultiProperty::details
 

The list of child properties.

Definition at line 112 of file multiproperty.h.

Referenced by PropertyLib::PropertyEditor::addChildProperties().

QPtrList<Property> PropertyLib::MultiProperty::list [private]
 

Definition at line 115 of file multiproperty.h.

Referenced by addProperty(), description(), MultiProperty(), name(), readOnly(), PropertyLib::PropertyList::removeProperty(), removeProperty(), setDescription(), setValue(), setValueList(), type(), undo(), valid(), value(), valueList(), and visible().

PropertyList* PropertyLib::MultiProperty::m_propertyList [private]
 

Definition at line 117 of file multiproperty.h.

Referenced by PropertyLib::PropertyBuffer::PropertyBuffer(), setValue(), and undo().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:33:08 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003