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 43 of file set.h.
|
Signals |
void | propertyChanged (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) |
| ~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) |
Property & | property (const QCString &name) |
Property & | operator[] (const QCString &name) |
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 StringListMap & | groups () |
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) |
Protected Attributes |
SetPrivate * | d |
Friends |
class | Iterator |
class | Property |
class | Buffer |
Classes |
class | Iterator |
| A class to iterate over a SetPrivate It behaves as a QDictIterator. To use it:. More...
|
Constructor & Destructor Documentation
Set::Set |
( |
const Set & |
set |
) |
|
Constructs a deep copy of set. The new object will not have a QObject parent even if set has such parent.
Definition at line 154 of file set.cpp.
Set::Set |
( |
bool |
propertyOwner |
) |
[protected] |
Constructs a set which owns or does not own it's properties.
Definition at line 161 of file set.cpp.
Member Function Documentation
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.
Emitted when property is about to be deleted.
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 208 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 180 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::changeProperty |
( |
const QCString & |
property, |
|
|
const QVariant & |
value | |
|
) |
| | |
void Set::clear |
( |
|
) |
[virtual] |
Removes all properties from the property set and destroys them.
Definition at line 238 of file set.cpp.
bool Set::contains |
( |
const QCString & |
name |
) |
|
- Returns:
- true if the set contains property names name.
Definition at line 333 of file set.cpp.
uint Set::count |
( |
|
) |
const |
Returns the number of items in the set.
Definition at line 309 of file set.cpp.
bool Set::isEmpty |
( |
|
) |
const |
Returns TRUE if the set is empty, i.e. count() == 0; otherwise it returns FALSE.
Definition at line 315 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 321 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 359 of file set.cpp.
Property & Set::operator[] |
( |
const QCString & |
name |
) |
|
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 353 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 405 of file set.cpp.
Property & Set::property |
( |
const QCString & |
name |
) |
|
- Returns:
- property named with name. If no such property is found, null property (Property::null) is returned.
Definition at line 339 of file set.cpp.
Emitted when the value of the property is changed.
Emitted when the value of the property is reset.
void Set::removeFromGroup |
( |
Property * |
property |
) |
[protected] |
Removes property from a group.
Definition at line 273 of file set.cpp.
void Set::removeProperty |
( |
const QCString & |
name |
) |
|
void Set::removeProperty |
( |
Property * |
property |
) |
|
Removes property from the set. Emits aboutToDeleteProperty before removing.
Definition at line 214 of file set.cpp.
void Set::setGroupDescription |
( |
const QCString & |
group, |
|
|
const QString |
desc | |
|
) |
| | |
Sets the i18n'ed string that will be shown in Editor to represent this group.
Definition at line 293 of file set.cpp.
void Set::setReadOnly |
( |
bool |
readOnly |
) |
|
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 417 of file set.cpp.
The documentation for this class was generated from the following files:
|