diff options
author | Ivan Tkachenko <me@ratijas.tk> | 2021-08-18 01:58:06 +0300 |
---|---|---|
committer | Ivan Tkachenko <me@ratijas.tk> | 2021-08-18 09:07:50 +0300 |
commit | afe72ba8cae6dc2cb1ddeeb569751ae186b54716 (patch) | |
tree | 3b927d26c3220142c45dc3d6fd875d95d7a7813b /src/qml/doc/snippets | |
parent | e366e570efd47fe2719fc07f728d0dc420be3611 (diff) |
doc: Improve QQmlParserStatus code snippet
Make it potentially compile-able by adding required headers (though it's
not like it's really being compiled anyway), and add `override` keyword
for methods which are actually re-declared from pure virtual base.
Change-Id: I7b0c13de6a63aacdb082517ca586fb9db8c1087a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qml/doc/snippets')
-rw-r--r-- | src/qml/doc/snippets/code/src_qml_qqmlparserstatus.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/doc/snippets/code/src_qml_qqmlparserstatus.cpp b/src/qml/doc/snippets/code/src_qml_qqmlparserstatus.cpp index 259ea15b3f..f5d6f824f2 100644 --- a/src/qml/doc/snippets/code/src_qml_qqmlparserstatus.cpp +++ b/src/qml/doc/snippets/code/src_qml_qqmlparserstatus.cpp @@ -48,6 +48,9 @@ ** ****************************************************************************/ +#include <QtCore/qobject.h> +#include <QtQml/qqmlparserstatus.h> + //! [0] class MyObject : public QObject, public QQmlParserStatus { @@ -57,7 +60,7 @@ class MyObject : public QObject, public QQmlParserStatus public: MyObject(QObject *parent = 0); // ... - void classBegin(); - void componentComplete(); + void classBegin() override; + void componentComplete() override; }; //! [0] |