KPropertySetIterator

KPropertySetIterator Class Reference

#include <KPropertySet.h>

Public Types

enum  Order { Order::Insertion, Order::Alphabetical, Order::AlphabeticalByName }
 

Public Member Functions

 KPropertySetIterator (const KPropertySet &set)
 
 KPropertySetIterator (const KPropertySet &set, const KPropertySelector &selector)
 
 KPropertySetIterator (const KPropertySetIterator &set)
 
KPropertycurrent () const
 
bool operator!= (const KPropertySetIterator &other) const
 
KPropertyoperator* () const
 
void operator++ ()
 
KPropertySetIteratoroperator= (const KPropertySetIterator &other)
 
bool operator== (const KPropertySetIterator &other) const
 
Order order () const
 
void setOrder (Order order)
 

Detailed Description

A class to iterate over a KPropertySet.

It behaves like a QList::ConstIterator. Usage:

for (KPropertySetIterator it(set); it.current(); ++it) { .... }

Usage with selector:

for (KPropertySetIterator it(set, MySelector()); it.current(); ++it) { .... }

Definition at line 57 of file KPropertySet.h.

Member Enumeration Documentation

Ordering options for properties.

See also
setOrder()
Enumerator
Insertion 

insertion order

Alphabetical 

alphabetical order (case-insensitively by captions)

AlphabeticalByName 

alphabetical order (case-insensitively by name)

Definition at line 92 of file KPropertySet.h.

Constructor & Destructor Documentation

KPropertySetIterator::KPropertySetIterator ( const KPropertySet set)
explicit

Creates iterator for set set of properties.

The properties are sorted by insertion order by default. Use setOrder(Iterator::Alphabetical) to have alphabetical order.

Definition at line 303 of file KPropertySet.cpp.

KPropertySetIterator::KPropertySetIterator ( const KPropertySet set,
const KPropertySelector selector 
)

Creates iterator for set set of properties.

selector functor is used to iterate only over specified properties. The properties are sorted by insertion order by default. Use setOrder(Iterator::Alphabetical) to have alphabetical order.

Definition at line 313 of file KPropertySet.cpp.

KPropertySetIterator::KPropertySetIterator ( const KPropertySetIterator set)

Copy constructor.

Since
3.1

Definition at line 325 of file KPropertySet.cpp.

Member Function Documentation

bool KPropertySetIterator::operator!= ( const KPropertySetIterator other) const
inline
Returns
true if this iterator does not equal to other
Since
3.1

Definition at line 88 of file KPropertySet.h.

KPropertySetIterator & KPropertySetIterator::operator= ( const KPropertySetIterator other)

Assigns other to this KPropertySetIterator.

Since
3.1

Definition at line 330 of file KPropertySet.cpp.

bool KPropertySetIterator::operator== ( const KPropertySetIterator other) const
Returns
true if this iterator equals to other
Since
3.1

Definition at line 338 of file KPropertySet.cpp.

KPropertySetIterator::Order KPropertySetIterator::order ( ) const
Returns
order for properties.

Definition at line 391 of file KPropertySet.cpp.

void KPropertySetIterator::setOrder ( KPropertySetIterator::Order  order)

Sets order for properties. Restarts the iterator.

Definition at line 348 of file KPropertySet.cpp.


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 Thu Aug 13 2020 23:03:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.