Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Module

From Qt Wiki
Revision as of 09:52, 10 July 2021 by Ben.cottrell (talk | contribs) (Created page with "== General Definition == A module can be defined as a set of C++ header files, classes, build system specific files and other content. The other files may include QML files wh...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

General Definition

A module can be defined as a set of C++ header files, classes, build system specific files and other content. The other files may include QML files which can re-used as components, and may accompany a qmldir file describing type information, and if applicable, shared libraries that the types depend upon. They are sets of files.

Modules in Qt are different from C++ modules, which are described here: https://en.cppreference.com/w/cpp/language/modules

Re-Using Modules

In a Qt installation on GNU/Linux, with the prefix “/Qt/6.2.0/gcc_64”, there will be module specific files for the ‘QtQuick’ directory contained within ‘qml’, ‘lib’ and ‘include’ under the prefix.

At build time, modules are used by using certain header files in source code, and by linking to shared libraries bearing the name of the module. There are module specfic scripts for CMake under ‘lib/cmake’ inside the installation prefix. These scripts provide variables which contain paths to the module directories, as well as the relevant libraries and options to consume a module.

Making a New Module

Please see this page: https://wiki.qt.io/Creating_a_new_module_or_tool_for_Qt