- Qbs Manual
- Qbs 1.18.1

# Qt.qml

Provides Qt QML support. More...

- List of all members, including inherited members

## Properties

- cacheFilesInstallDir : string
- cachingEnabled : bool
- extraMetaTypesFiles : stringList
- generateCacheFiles : bool
- importName : string
- importVersion : string
- qmlCacheGenPath : string
- qmlImportScannerName : string
- qmlPath : string
- typesFileName : string
- typesInstallDir : string

## Detailed Description

The Qt.qml module provides support for the Qt QML module, which contains classes for QML and JavaScript languages.

Note: If the current value of qbs.architecture is not supported by `qmlcachegen`, the QML cache file generator rule is disabled.

### Relevant 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.
`"qt.qml.types"` | n/a | 1.16 | This tag is attached to the files created by the `qmltyperegistrar` tool if the importName property is set.

See also Qt.quick and Qt.declarative.

## Property Documentation

cacheFilesInstallDir : string

The path to the directory where the cache files are installed.

If this property is set, QML cache files are automatically installed.

Default: Undefined

[read-only] cachingEnabled : bool

This property is `true` if generateCacheFiles is `true` and the platform supports QML cache generation.

Default: `false`

extraMetaTypesFiles : stringList

Specifies extra metatypes files to pass to the `qmltyperegistrar` tool via the `--foreign-types` option when registering QML types.

Note: This property is only needed for external libraries, not products or modules pulled via `Depends` items. In particular, you don't need to (and should not) use it to collect the metatypes files of Qt modules. These are found automatically. This property has no effect if importName is not set.

Default: Undefined

This property was introduced in Qbs 1.16.

generateCacheFiles : bool

Whether QML cache files are generated.

Default: `false`

importName : string

Setting this value triggers QML type registration via the `qmltyperegistrar` tool, which results in the creation of a file with the tag `"qt.qml.types"`. The given string is the name under which the registered types can be imported by QML code that wants to use them.

Note: This functionality is only available with Qt 5.15 or later.

Default: Undefined

This property was introduced in Qbs 1.16.

importVersion : string

Specifies the version of the types to be registered. Values consist of a major and an optional minor number, separated by dots. This property has no effect if importName is not set.

Default: The product version

This property was introduced in Qbs 1.16.

qmlCacheGenPath : string

The absolute path to the `qmlcachegen` executable.

Default: Determined by setup-qt.

qmlImportScannerName : string

The base name of the QML import scanner.

Set this value if your system uses a name different from the default value.

Default: `"qmlimportscanner"`

qmlPath : string

The absolute path to the directory where Qt's QML files are installed.

Default: Determined by setup-qt.

typesFileName : string

Specifies the name of the file that declares the types registered for this product. For applications, the default value is `<name>.qmltypes`, where `<name>` is the product's target name. Otherwise, the default value is "plugins.qmltypes".

Note: The naming conventions are still in flux. When in doubt, consult the Qt documentation.

This property has no effect if importName is not set.

This property was introduced in Qbs 1.16.

typesInstallDir : string

The directory to install the qmltypes file into. If this property is empty or undefined, the file will not be installed. This property has no effect if importName is not set.

Default: Undefined

This property was introduced in Qbs 1.16.