6.0.0-rc4Source

QQmlParserStatus Class

The QQmlParserStatus class tells an object when QML starts and finishes making it. More…

Header#include <QQmlParserStatus>
CMaketarget_link_libraries(app PRIVATE Nt::Qml)
ModuleNt Qml C++ Classes
Inherited byQtFM::FmSound

List of all members, including inherited members

Public Functions

virtual ~QQmlParserStatus()
virtual voidclassBegin()
virtual voidcomponentComplete()

Detailed Description

A C++ type that needs all its properties before it can do its work inherits QQmlParserStatus as well as QObject: classBegin() is called when the object has been made, before its properties are set, and componentComplete() when its component is complete, all bindings set.

class Loader : public QObject, public QQmlParserStatus {
    Q_OBJECT
    Q_INTERFACES(QQmlParserStatus)
    ...
    void classBegin() override {}
    void componentComplete() override { load(m_source); }
};

Differences from Qt

None; Q_INTERFACES is not needed in Nt, which finds the interface with dynamic_cast.

Member Function Documentation

[virtual] QQmlParserStatus::~QQmlParserStatus()

Destroys the object.

[virtual] void QQmlParserStatus::classBegin()

Called when the object has been made, before its properties are set.

[virtual] void QQmlParserStatus::componentComplete()

Called when the component of the object is complete: all its objects made and their bindings set.