diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-04-27 12:09:01 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-30 04:33:55 +0200 |
commit | 15692017d5b94302305bf15cfd1dd34dcc8a3a9e (patch) | |
tree | 2c957259fbacfeae81767fa2b8cc63abc05d43a6 /src/qml/qml/qqmlparserstatus.cpp | |
parent | ce02c2fdaf32e2edd05f8a9855477791610f77e5 (diff) |
Mention the common usecase for classBegin in QQmlParserStatus doc
Change-Id: I17800a5f03831750432eab2775a47f6146733e92
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlparserstatus.cpp')
-rw-r--r-- | src/qml/qml/qqmlparserstatus.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlparserstatus.cpp b/src/qml/qml/qqmlparserstatus.cpp index 8468a1da00..b895034046 100644 --- a/src/qml/qml/qqmlparserstatus.cpp +++ b/src/qml/qml/qqmlparserstatus.cpp @@ -60,6 +60,13 @@ QT_BEGIN_NAMESPACE when the \c font is assigned, and relayout again when the \c width is assigned, and so on). + Be aware that QQmlParserStatus methods are only called when a class is instantiated + by a QQmlEngine. If you create the same class directly from C++, these methods will + not be called automatically. To avoid this problem, it is recommended that you start + deferring operations from classBegin instead of from the initial creation of your class. + This will still prevent multiple revaluations during initial binding assignment in QML, + but will not defer operations invoked from C++. + To use QQmlParserStatus, you must inherit both a QObject-derived class and QQmlParserStatus, and use the Q_INTERFACES() macro. |