Qbs Manual | List of Modules | Qt Modules

Qbs 1.10.0

# Qt Modules

The `Qt.*` modules contain properties and rules for Qt.

## Creating Dependencies to Qt Modules

The Qt modules are special in that they are submodules within the `Qt` "namespace", which has ramifications on the syntax when expressing dependencies. Assume your product depends on the `core` and `network` modules. Then you could write:

      Depends { name: "Qt.core" }
      Depends { name: "Qt.network" }

Or, alternatively:

      Depends { name: "Qt"; submodules: ["core", "network" } }

## List of Submodules

Submodule Name | Qt Module Name | Notes
--- | --- | ---
axcontainer | QAxContainer | This module is only available on Windows.
axserver | QAxServer | This module is only available on Windows.
concurrent | Qt Concurrent |
core | Qt Core | All other `Qt` modules have a dependency to this one, so you do not need to list it in your dependencies if you depend on at least one other `Qt` module. For more information on the properties you can specify, see core Properties. For more information on the relevant file tags, see core File Tags.
dbus | Qt D-Bus | For more information on the properties you can specify, see dbus Properties. For more information on the relevant file tags, see dbus File Tags.
declarative | Qt Quick 1 | Provides the `Qt Quick 1` module. For more information, see declarative Properties.
designer | Qt Designer |
enginio | Qt Enginio |
gui | Qt GUI | For more information on the properties you can specify, see gui Properties. For more information on the relevant file tags, see gui File Tags.
help | Qt Help | You do not need this module for building `qdoc` documentation, because that functionality is part of the `core` module. This module is for using Qt classes such as `QHelpEngine`.
multimedia | Qt Multimedia |
multimediawidgets | Qt Multimedia Widgets |
network | Qt Network |
opengl | Qt OpenGL |
phonon | Phonon (Qt 4 only) |
printsupport | Qt Print Support |
quick | Qt Quick (2) | Provides the `Qt Quick` module (Qt Quick 2). For more information, see quick Properties and quick File Tags.
qml | Qt QML | For more information on the properties you can specify, see qml Properties. For more information on the relevant file tags, see qml File Tags.
script | Qt Script |
scxml | Qt Scxml | For more information on the properties you can specify, see scxml Properties. For more information on the relevant file tags, see scxml File Tags.
sql | Qt SQL |
svg | Qt SVG |
testlib | Qt Test |
webkit | Qt WebKit |
webkitwidgets | Qt WebKit Widgets |
widgets | Qt Widgets |
xml | Qt XML | You do not need this module for the `QXmlStreamReader` and `QXmlStreamWriter` classes, because those classes are a part of the `core` module. This module provides the deprecated DOM and SAX classes.
xmlpatterns | Qt XML Patterns |  |

## Module Properties

The following sections describe the properties of Qt modules that can be interesting to users.

### core Properties

Some of the following properties only need to be defined if the respective installation of Qt was built in some unusual way, for instance by setting non-default `configure` flags.

Property | Type | Default | Description
--- | --- | --- | ---
availableBuildVariants | `stringList` | set by `qbs-setup-qt` | The build variants that this Qt installation offers.
binPath | `path` | `undefined` | The path in which Qt tools such as `qmake`, `moc` and so on are located.
combineMocOutput | `bool` | `cpp.combineCxxSources` | If this property is enabled, the C++ sources created by `moc` are combined into a single C++ file per product. For projects where many header files are to be handled by `moc`, this can speed up compilation considerably. However, side effects may occur as a result of merging translation units.
config | `stringList` | `empty` | Corresponds to the default value of qmake's `CONFIG` variable.
docPath | `path` | `undefined` | The path in which the Qt documentation is located.
enableKeywords | bool | true | Set this property to `false` if you do not want Qt to define the symbols `signals`, `slots`, and `emit`. This can be necessary if your project interacts with code that also defines such symbols.
frameworkBuild | `bool` | `undefined` | Specifies whether Qt was built as a framework. This is only relevant for Darwin systems.
incPath | `path` | `undefined` | The base path of the Qt headers.
libInfix | `string` | `empty` | The library infix can be set at Qt build time to change the name of Qt's libraries. For instance, if the infix is "Test", then on Unix systems, the `Qt Core` library will be in a file called `libQt5CoreTest.so` instead of the default `libQt5Core.so`.
libPath | `path` | `undefined` | The path in which the Qt libraries are located.
lreleaseMultiplexMode | `bool` | `false` | If this property is `true`, `lrelease` will merge all ts files into one qm file. Otherwise, one qm file will be created for every ts file.
lreleaseName | `string` | `"lrelease"` | The base name of the `lrelease` tool. Set this if your system uses a name such as "lrelease-qt4".
mkspecPath | `path` | `undefined` | The path in which the Qt mkspecs are located.
mocFlags | `stringList` | empty | Additional flags to `moc`. You will rarely need to set this property.
mocName | `string` | `"moc"` | The base name of the `moc` tool. Set this if your system uses a name such as "moc-qt4".
namespace | `string` | `undefined` | The Qt namespace that can be set at build time via the `configure` script. By default, Qt is not built in a namespace.
pluginMetaData | `stringList` | empty | Additional plugin meta data. The elements of the list are key-value pairs separated by the `=` character. A possible use case is to set the plugin URI when building a static QML plugin:
      Qt.core.pluginMetaData: ["uri=thePlugin"]
pluginPath | `path` | `undefined` | The path in which the Qt plugins are located.
qdocEnvironment | `stringlist` | `undefined` | The environment for calls to `qdoc`. Typically, you will need to set some variables here when running `qdoc` to build your project documentation.
qdocName | `string` | `"qdoc3"` for Qt 4, `"qdoc"` otherwise | The base name of the `qdoc` tool.
qmBaseName | `string` | `product.targetName` | The base name of the qm file to be built from the ts files in the product. This property is ignored if `lreleaseMultiplexMode` is `false`.
qtBuildVariant | `string` | See below. | Specifies the type of Qt libraries to build against: "debug" or "release". The default value is the build variant of the code linking against Qt. If Qt does not offer that build variant, the build variant offered by Qt is chosen instead. Note: On some systems, it is not possible to link code built in debug mode against libraries built in release mode and vice versa.
qtConfig | `stringList` | `empty` | Corresponds to the default value of qmake's `QT_CONFIG` variable.
resourceSourceBase | `path` | `undefined` | For files tagged as `qt.core.resource_data`, this property determines which part of their path will end up in the generated `qrc` file. If this property is set to `undefined`, only the file name is used.
resourcePrefix | `string` | `"/"` | For files tagged as `qt.core.resource_data`, this property determines the prefix under which they will be available in the generated `qrc` file.
resourceFileBaseName | `string` | `product.targetName` | For files tagged as `qt.core.resource_data`, this property determines the base name of the generated `qrc` file. If this property needs to be changed, it must be set in the corresponding product rather than in a Group.
staticBuild | `bool` | `undefined` | Specifies whether Qt was built statically.
version | `string` | `undefined` | The Qt version. Consists of three numbers separated by dots, for instance "5.1.1".
versionMajor | `int` | `versionParts[0]` | The Qt major version.
versionMinor | `int` | `versionParts[1]` | The Qt minor version.
versionParts | `list` | `empty` | The Qt version as a list. For instance, Qt version 5.1.1 would correspond to a value of `[5, 1, 1]`.
versionPatch | `int` | `versionParts[2]` | The Qt patch level.

### dbus Properties

Property | Type | Default | Description
--- | --- | --- | ---
xml2cppName | `string` | `"qdbusxml2cpp"` | The base name of the `qdbusxml2cpp` tool. Set this if your system uses a different name.
xml2CppHeaderFlags | `stringList` | empty list | Additional flags when running the `qdbusxml2cpp` tool to create header files.
xml2CppSourceFlags | `stringList` | empty list | Additional flags when running the `qdbusxml2cpp` tool to create source files.

### declarative Properties

Property | Type | Default | Description
--- | --- | --- | ---
qmlDebugging | `bool` | `false` | Specifies whether QML debugging support should be compiled into your binaries.
qmlImportsPath | `string` | set by `qbs-setup-qt` | The absolute path to the directory where Qt's QML imports are installed.
qmlPath | `string` | set by `qbs-setup-qt` | The absolute path to the directory where Qt's QML files are installed. This property is undefined for Qt4.

### gui Properties

Property | Type | Default | Description
--- | --- | --- | ---
uicName | `string` | `"uic"` | The base name of the `uic` tool. Set this if your system uses a name such as "uic-qt4".

### quick Properties

Property | Type | Default | Description
--- | --- | --- | ---
compilerAvailable | `bool` | set by `qbs-setup-qt` | Specifies whether the Qt installation contains the Qt Quick compiler.
qmlDebugging | `bool` | `false` | Specifies whether QML debugging support should be compiled into your binaries.
qmlImportsPath | `string` | set by `qbs-setup-qt` | The absolute path to the directory where Qt's QML imports are installed.
qmlPath | `string` | set by `qbs-setup-qt` | The absolute path to the directory where Qt's QML files are installed. This property is undefined for Qt4.

### qml Properties

Property | Type | Default | Description
--- | --- | --- | ---
qmlImportScannerName | `string` | `"qmlimportscanner"` | The base name of the QML import scanner. Set this if your system uses a different name.
qmlPath | `string` | set by `qbs-setup-qt` | The absolute path to the directory where Qt's QML files are installed.

The following properties control the generation of QML cache files.

Property | Type | Default | Description
--- | --- | --- | ---
generateCacheFiles | `bool` | `false` | Enables the generation of QML cache files.
cachingEnabled | `readonly bool` | `false` | Is true if `generateCacheFiles` is `true` and the platform supports QML cache generation.
qmlCacheGenPath | `string` | set by `qbs-setup-qt` | The absolute path to the qmlcachegen executable.
cacheFilesInstallDir | `string` | `undefined` | The path to the directory where the cache files are installed. If this property is set then QML cache files are automatically installed.

Note: If the current value of qbs.architecture is not supported by qmlcachegen then the cache generator rule is disabled.

### scxml Properties

Property | Type | Default | Description
--- | --- | --- | ---
className | `string` | `undefined` | The class name of the generated state machine. By default, the compiler will use the `name` attribute of the input file's `<scxml>` tag.
namespace | `string` | `undefined` | The C++ namespace in which to put the generated class. By default, the compiler will place the class in the global namespace.
qscxmlcName | `string` | `"qscxmlc"` | The base name of the Qt SCXML compiler. Set this if your system uses a different name.

## Relevant File Tags

The following sections describe the file tags that are relevant for the Qt modules.

### core File Tags

Tag | Auto-tagged File Names | Since | Description
--- | --- | --- | ---
`"qch"` | n/a | 1.1 | This tag is attached to the output artifacts of the rule that runs the `qhelpgenerator` tool.
`"qdoc"` | `*.qdoc` | 1.1 | Source files with this tag trigger a re-execution of the rule running the `qdoc` tool when their timestamp changes.
`"qdocconf"` | `*.qdocconf` | 1.1 | Source files with this tag trigger a re-execution of the rule running the `qdoc` tool when their timestamp changes.
`"qdocconf-main"` | - | 1.1 | Source files with this tag serve as inputs to the rule running the `qdoc` tool.
`"qdoc-output"` | n/a | 1.5 | Use this tag to match all `qdoc` outputs, for instance in a Group using the `fileTagsFilter` property.
`"qhp"` | `*.qhp` | 1.1 | Files with this tag serve as inputs to the rule running the `qhelpgenerator` tool. Such files are created by `qdoc`, but can also appear as source files.
`"qm"` | n/a | 1.1 | This tag is attached to the output artifacts of the rule that runs the `lrelease` tool.
`"qrc"` | `*.qrc` | 1.0 | Files with this tag serve as inputs to the rule running the `rcc` tool.
`"qt_plugin_metadata"` | - | 1.0 | Source files with this tag trigger a re-execution of the rule running the `moc` tool when their timestamp changes.
`"qt.core.resource_data"` | - | 1.7 | Source files with this tag serve as inputs to the rule creating `qrc` files.
`"ts"` | `*.ts` | 1.0 | Files with this tag serve as inputs to the rule running the `lrelease` tool.

### dbus File Tags

Tag | Auto-tagged File Names | Since | Description
--- | --- | --- | ---
`"qt.dbus.adaptor"` | - | 1.5 | Source files with this tag serve as inputs to the rule running the `qdbusxml2cpp` tool, which will create an adaptor class.
`"qt.dbus.interface"` | - | 1.5 | Source files with this tag serve as inputs to the rule running the `qdbusxml2cpp` tool, which will create an interface class.

### gui File Tags

Tag | Auto-tagged File Names | Since | Description
--- | --- | --- | ---
`"ui"` | `*.ui` | 1.0 | Source files with this tag serve as inputs to the rule running the `uic` tool.

### qml File Tags

Tag | Auto-tagged File Names | Since | Description
--- | --- | --- | ---
`"qt.qml.js"` | `*.js` | 1.10 | QML companion JavaScript files. Source files with this tag serve as input for the QML cache file generator.
`"qt.qml.qml"` | `*.qml` | 1.8 | Source files with this tag serve as inputs to the QML plugin scanner.

### quick File Tags

Tag | Auto-tagged File Names | Since | Description
--- | --- | --- | ---
`"qt.quick.qrc"` | `*.qrc` | 1.10 | Qt resource files with this file tag will be picked up by the Qt Quick compiler rule, and all QML files in the resource will be compiled. This file tag will only be added automatically if the Qt Quick compiler is available.

### scxml File Tags

Tag | Auto-tagged File Names | Since | Description
--- | --- | --- | ---
`"qt.scxml.compilable"` | - | 1.7 | Source files with this tag serve as inputs to the rule running the Qt SCXML compiler, which will create a C++ class representing a state machine.