Mention the common usecase for classBegin in QQmlParserStatus doc
authorAlan Alpert <alan.alpert@nokia.com>
Fri, 27 Apr 2012 02:09:01 +0000 (12:09 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 30 Apr 2012 02:33:55 +0000 (04:33 +0200)
Change-Id: I17800a5f03831750432eab2775a47f6146733e92
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
src/qml/qml/qqmlparserstatus.cpp

index 8468a1d..b895034 100644 (file)
@@ -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.