Legacy Modules | Qt Qml (original) (raw)

Legacy modules are modules whose specification qmldir file does not contain a module identifier directive. A legacy module may be either installed into the QML import path (as an installed legacy module) or imported by clients with a relative import (as a located legacy module). Clients are advised to avoid using legacy modules if possible. Module developers should ensure they create identified modules and not legacy modules.

Installed Legacy Modules

An installed, non-identified module is automatically given an identifier by the QML engine. This implicitly defined identifier is equal to the install path of the module (relative to the QML import path) where directory-separator characters are replaced with period characters.

A non-identified module which is installed into the QML import path has the following semantics:

Located Legacy Modules

A non-identified module which is imported via a relative directory path import statement is loaded by the engine as a located legacy module. The following semantics apply to located legacy modules:

A located legacy module may reside on the local file system or on the network and can be referred to by a URL that specifies the file system path or network URL.

See also Modern QML modules and Port QML modules to CMake.

Identified Modules Creating C++ Plugins for QML

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.