QScriptClassPropertyIterator Class

The QScriptClassPropertyIterator class provides an iterator interface for custom Qt Script objects. More...

Header: #include <QScriptClassPropertyIterator>
qmake: QT += script
Since: Qt 4.4

This class was introduced in Qt 4.4.

Public Functions

virtual ~QScriptClassPropertyIterator()
virtual QScriptValue::PropertyFlags flags() const
QScriptValue object() const

Protected Functions

QScriptClassPropertyIterator(const QScriptValue &object)

Detailed Description

This class is only relevant if you have subclassed QScriptClass and want to provide enumeration of your custom properties (e.g. when objects of your class are used with QScriptValueIterator, or with the for-in statement in scripts).

The object() function returns the Qt Script object the iterator is traversing.

toFront(), hasNext() and next() provide forward iteration.

toBack(), hasPrevious() and previous() provide backward iteration.

name(), id() and flags() return information about the last property that was jumped over using next() or previous().

See also QScriptClass::newIterator() and QScriptValueIterator.

Member Function Documentation

[protected] QScriptClassPropertyIterator::QScriptClassPropertyIterator(const QScriptValue &object)

Constructs an iterator for traversing object.

Subclasses should ensure that the iterator is set to the front of the sequence of properties (before the first property).

[virtual] QScriptClassPropertyIterator::~QScriptClassPropertyIterator()

Destroys the iterator.

[virtual] QScriptValue::PropertyFlags QScriptClassPropertyIterator::flags() const

Returns the flags of the last property that was jumped over using next() or previous().

The default implementation calls the propertyFlags() function of object() with argument name().

QScriptValue QScriptClassPropertyIterator::object() const

Returns the Qt Script object this iterator is traversing.