QScriptClassPropertyIterator Class

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

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

该类在 Qt 4.4 引入。

公共函数

virtual ~QScriptClassPropertyIterator ()
virtual QScriptValue::PropertyFlags flags () const
virtual bool hasNext () const = 0
virtual bool hasPrevious () const = 0
virtual uint id () const
virtual QScriptString name () const = 0
virtual void next () = 0
QScriptValue 对象 () const
virtual void previous () = 0
virtual void toBack () = 0
virtual void toFront () = 0

保护函数

QScriptClassPropertyIterator (const QScriptValue & object )

详细描述

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 对象 () function returns the Qt Script object the iterator is traversing.

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

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

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

另请参阅 QScriptClass::newIterator () 和 QScriptValueIterator .

成员函数文档编制

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

构造迭代器为遍历 object .

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

[虚拟] QScriptClassPropertyIterator:: ~QScriptClassPropertyIterator ()

销毁迭代器。

[虚拟] QScriptValue::PropertyFlags QScriptClassPropertyIterator:: flags () const

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

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

[pure virtual] bool QScriptClassPropertyIterator:: hasNext () const

Returns true if there is at least one item ahead of the iterator (i.e. the iterator is not at the back of the property sequence); otherwise returns false.

另请参阅 next () 和 hasPrevious ().

[pure virtual] bool QScriptClassPropertyIterator:: hasPrevious () const

Returns true if there is at least one item behind the iterator (i.e. the iterator is not at the front of the property sequence); otherwise returns false.

另请参阅 previous () 和 hasNext ().

[虚拟] uint QScriptClassPropertyIterator:: id () const

Returns the id of the last property that was jumped over using next () 或 previous ().

The default implementation returns 0.

另请参阅 name ().

[pure virtual] QScriptString QScriptClassPropertyIterator:: name () const

Returns the name of the last property that was jumped over using next () 或 previous ().

另请参阅 id ().

[pure virtual] void QScriptClassPropertyIterator:: next ()

Advances the iterator by one position.

Calling this function on an iterator located at the back of the container leads to undefined results.

另请参阅 hasNext (), previous (),和 name ().

QScriptValue QScriptClassPropertyIterator:: 对象 () const

Returns the Qt Script object this iterator is traversing.

[pure virtual] void QScriptClassPropertyIterator:: previous ()

Moves the iterator back by one position.

Calling this function on an iterator located at the front of the container leads to undefined results.

另请参阅 hasPrevious (), next (),和 name ().

[pure virtual] void QScriptClassPropertyIterator:: toBack ()

Moves the iterator to the back of the QScriptValue (after the last property).

另请参阅 toFront () 和 previous ().

[pure virtual] void QScriptClassPropertyIterator:: toFront ()

Moves the iterator to the front of the QScriptValue (before the first property).

另请参阅 toBack () 和 next ().