diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-17 14:00:21 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-20 09:06:04 +0100 |
commit | 08c78ecb91df3cb67934a89d84091775aa1e2bb8 (patch) | |
tree | 3bf58017e9be137c257604eee166ced99be2f1e6 | |
parent | 87d9234d71122f0332c37c81ca0338ddcda7eeba (diff) |
Doc: Fix imports documentation
We promote QML_ELEMENT and QML_NAMED_ELEMENT() ways to declare types,
rather than qmlRegisterType().
Change-Id: I78d64a0ab4412499815da8c0f71bea6dc5dd0b93
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r-- | src/qml/doc/src/qmllanguageref/syntax/imports.qdoc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc index 32106d5bb8..fdba452271 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/imports.qdoc @@ -127,15 +127,15 @@ Rectangle { In this case, the engine will emit an error and refuse to load the file. -\section4 Non-module Namespace Imports +\section4 C++ Module Imports -Types can also be registered into namespaces directly via the various -registration functions in C++ (such as qmlRegisterType()). The types which -have been registered into a namespace in this way may be imported by importing -the namespace, as if the namespace was a module identifier. +Usually, C++ types are declared using the QML_ELEMENT and QML_NAMED_ELEMENT() +macros and registered via the build system using QML_IMPORT_NAME and +QML_IMPORT_MAJOR_VERSION. The import name and version given this way form a +module that can be imported to access the types. This is most common in client applications which define their own QML object -types in C++ and register them with the QML type system manually. +types in C++. \section4 Importing into a Qualified Local Namespace |