diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-04-28 11:55:37 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-04-29 12:47:25 +0200 |
commit | 100ac186a2dcfacc173af340c15f3b942017e7ad (patch) | |
tree | f6a4c2b972e0f87bbdd419e60d99287ba5489b5a /src/qml/doc/src/qmlfunctions.qdoc | |
parent | e25bd7a3b76107eb3da3e1eb4e8667ce99b4d20a (diff) |
Doc: add code example to QML_NAMED_ELEMENT
I always forget that you don't pass a string.
Pick-to: 5.15
Change-Id: Ied1bf64c8da5e37c38dab8633c048ce4851f8fc4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/doc/src/qmlfunctions.qdoc')
-rw-r--r-- | src/qml/doc/src/qmlfunctions.qdoc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 0ff0de1ef9..9c8cd5e859 100644 --- a/src/qml/doc/src/qmlfunctions.qdoc +++ b/src/qml/doc/src/qmlfunctions.qdoc @@ -79,6 +79,16 @@ Declares the enclosing type or namespace to be available in QML, using \a name as the element name. Otherwise behaves the same as QML_ELEMENT. + \code + class SqlEventDatabase : public QObject + { + Q_OBJECT + QML_NAMED_ELEMENT(EventDatabase) + + // ... + }; + \endcode + \sa {Choosing the Correct Integration Method Between C++ and QML}, QML_ELEMENT */ |