lib
KoProperty::Set Class Reference#include <set.h>
Inheritance diagram for KoProperty::Set:
List of all members.
Detailed Description
Lists holding properties in groups.
- Author:
- Cedric Pasteur <cedric.pasteur@free.fr>
Alexander Dymo <cloudtemple@mskat.net>
Jaroslaw Staniek <js@iidea.pl>
Definition at line 40 of file set.h.
|
Signals |
void | propertyChanged (KoProperty::Set &set, KoProperty::Property &property) |
void | propertyChangedInternal (KoProperty::Set &set, KoProperty::Property &property) |
void | propertyReset (KoProperty::Set &set, KoProperty::Property &property) |
void | aboutToDeleteProperty (KoProperty::Set &set, KoProperty::Property &property) |
void | aboutToBeCleared () |
void | aboutToBeDeleted () |
Public Member Functions |
| Set (QObject *parent=0, const QString &typeName=QString::null) |
| Set (const Set &set) |
virtual | ~Set () |
void | addProperty (Property *property, QCString group="common") |
void | removeProperty (Property *property) |
void | removeProperty (const QCString &name) |
virtual void | clear () |
uint | count () const |
bool | isEmpty () const |
bool | isReadOnly () const |
void | setReadOnly (bool readOnly) |
bool | contains (const QCString &name) const |
Property & | property (const QCString &name) const |
Property & | operator[] (const QCString &name) const |
const Set & | operator= (const Set &set) |
void | changeProperty (const QCString &property, const QVariant &value) |
void | setGroupDescription (const QCString &group, const QString &desc) |
QString | groupDescription (const QCString &group) const |
void | setGroupIcon (const QCString &group, const QString &icon) |
QString | groupIcon (const QCString &group) const |
const QValueList< QCString > & | groupNames () const |
const QValueList< QCString > & | propertyNamesForGroup (const QCString &group) const |
QCString | prevSelection () const |
void | setPrevSelection (const QCString &prevSelection) |
QString | typeName () const |
void | debug () |
Protected Member Functions |
| Set (bool propertyOwner) |
void | addToGroup (const QCString &group, Property *property) |
void | removeFromGroup (Property *property) |
void | addPropertyInternal (Property *property, QCString group, bool updateSortingKey) |
void | informAboutClearing (bool &cleared) |
Protected Attributes |
SetPrivate * | d |
Friends |
class | Iterator |
class | Property |
class | Buffer |
Classes |
class | Iterator |
| A class to iterate over a Set. It behaves like a QDictIterator. To use it:. More...
|
Constructor & Destructor Documentation
Set::Set |
( |
const Set & |
set |
) |
[explicit] |
Constructs a deep copy of set. The new object will not have a QObject parent even if set has such parent.
Definition at line 142 of file set.cpp.
Set::Set |
( |
bool |
propertyOwner |
) |
[protected] |
Constructs a set which owns or does not own it's properties.
Definition at line 149 of file set.cpp.
Member Function Documentation
void Set::addProperty |
( |
Property * |
property, |
|
|
QCString |
group = "common" | |
|
) |
| | |
Adds the property to the set, in the group. You can use any group name, except "common" (which is already used for basic group).
Definition at line 196 of file set.cpp.
void Set::removeProperty |
( |
Property * |
property |
) |
|
Removes property from the set. Emits aboutToDeleteProperty before removing.
Definition at line 202 of file set.cpp.
void Set::removeProperty |
( |
const QCString & |
name |
) |
|
void Set::clear |
( |
|
) |
[virtual] |
Removes all properties from the property set and destroys them.
Definition at line 226 of file set.cpp.
uint Set::count |
( |
|
) |
const |
- Returns:
- the number of items in the set.
Definition at line 332 of file set.cpp.
bool Set::isEmpty |
( |
|
) |
const |
- Returns:
- true if the set is empty, i.e. count() == 0; otherwise returns false.
Definition at line 338 of file set.cpp.
bool Set::isReadOnly |
( |
|
) |
const |
- Returns:
- true if the set is read-only. In read-only property set, no property can be modified regardless of read-only flag of any property (see Property::isReadOnly()). On the other hand, if Property::isReadOnly() is true of a property and Set::isReadOnly() is false, the property is still read-only. Read-only property set prevents editing in the property editor. By default the set is read-write.
Definition at line 344 of file set.cpp.
void Set::setReadOnly |
( |
bool |
readOnly |
) |
|
bool Set::contains |
( |
const QCString & |
name |
) |
const |
- Returns:
- true if the set contains property names name.
Definition at line 356 of file set.cpp.
Property & Set::property |
( |
const QCString & |
name |
) |
const |
- Returns:
- property named with name. If no such property is found, null property (Property::null) is returned.
Definition at line 362 of file set.cpp.
Property & Set::operator[] |
( |
const QCString & |
name |
) |
const |
Accesses a property by it's name. Property reference is returned, so all property modifications are allowed. If there is no such property, null property is returned, so it's good practice to use contains() is you're unsure if the property exists. For example, to set a value of a property, use: /code Set set; ... if (!set.contains("myProperty")) { dosomething; } set["myProperty"].setValue("My Value"); /endcode - Returns:
- Property with given name.
Definition at line 368 of file set.cpp.
const Set & Set::operator= |
( |
const Set & |
set |
) |
|
Creates a deep copy of set and assigns it to this property set.
updateSortingKey, because the key is already set in Property copy ctor.
Definition at line 374 of file set.cpp.
void Set::changeProperty |
( |
const QCString & |
property, |
|
|
const QVariant & |
value | |
|
) |
| | |
void Set::setGroupDescription |
( |
const QCString & |
group, |
|
|
const QString & |
desc | |
|
) |
| | |
Sets the i18n'ed string that will be shown in Editor to represent group.
Definition at line 304 of file set.cpp.
QString Set::groupDescription |
( |
const QCString & |
group |
) |
const |
- Returns:
- the i18n'ed description string for group that will be shown in Editor to represent group. If there is no special description set for the group, group is just returned.
Definition at line 310 of file set.cpp.
void Set::setGroupIcon |
( |
const QCString & |
group, |
|
|
const QString & |
icon | |
|
) |
| | |
Sets the icon name icon to be displayed for group.
Definition at line 318 of file set.cpp.
QString Set::groupIcon |
( |
const QCString & |
group |
) |
const |
- Returns:
- the icons name for group.
Definition at line 324 of file set.cpp.
const QValueList< QCString > & Set::groupNames |
( |
|
) |
const |
- Returns:
- a list of all group names. The order is the same as the order of creation.
Definition at line 292 of file set.cpp.
const QValueList< QCString > & Set::propertyNamesForGroup |
( |
const QCString & |
group |
) |
const |
- Returns:
- a list of all property names. The order is the same as the order of creation.
Definition at line 298 of file set.cpp.
QCString Set::prevSelection |
( |
|
) |
const |
Used by property editor to preserve previous selection when this set is assigned again.
Definition at line 420 of file set.cpp.
QString Set::typeName |
( |
|
) |
const |
A name of this property set type, that is usable when we want to know if two property set objects have the same type. This avoids e.g. reloading of all Editor's contents. Also, this allows to know if two property set objects are compatible by their property sets. For comparing purposes, type names are case insensitive.
Definition at line 432 of file set.cpp.
Prints debug output for this set.
Definition at line 406 of file set.cpp.
void Set::addToGroup |
( |
const QCString & |
group, |
|
|
Property * |
property | |
|
) |
| | [protected] |
Adds property to a group.
Definition at line 252 of file set.cpp.
void Set::removeFromGroup |
( |
Property * |
property |
) |
[protected] |
Removes property from a group.
Definition at line 274 of file set.cpp.
void Set::addPropertyInternal |
( |
Property * |
property, |
|
|
QCString |
group, |
|
|
bool |
updateSortingKey | |
|
) |
| | [protected] |
Adds the property to the set, in the group. You can use any group name, except "common" (which is already used for basic group). If updateSortingKey is true, the sorting key will be set automatically to count().
Definition at line 168 of file set.cpp.
Emitted when the value of the property is changed.
Emitted when the value of the property is reset.
Emitted when property is about to be deleted.
void KoProperty::Set::aboutToBeCleared |
( |
|
) |
[signal] |
Emitted when property set object is about to be cleared (using clear()). This signal is also emmited from destructor before emitting aboutToBeDeleted().
void KoProperty::Set::aboutToBeDeleted |
( |
|
) |
[signal] |
Emitted when property set object is about to be deleted.
The documentation for this class was generated from the following files:
|