- Qbs Manual
- Qbs 1.21.0

# Qt.core

Provides Qt Core support. More...

- List of all members, including inherited members

## Properties

- availableBuildVariants : stringList
- binPath : path
- combineMocOutput : bool
- config : stringList
- docPath : path
- enableBigResources : bool
- enableKeywords : bool
- frameworkBuild : bool
- generateMetaTypesFile : bool
- incPath : path
- libInfix : string
- libPath : path
- lreleaseMultiplexMode : bool
- lreleaseName : string
- metaTypesInstallDir : bool
- mkspecPath : path
- mocFlags : stringList
- mocName : string
- namespace : string
- pluginMetaData : stringList
- pluginPath : path
- qdocEnvironment : stringList
- qdocName : string
- qmBaseName : string
- qtBuildVariant : string
- qtConfig : stringList
- resourceFileBaseName : string
- resourcePrefix : string
- resourceSourceBase : path
- staticBuild : bool
- version : string
- versionMajor : int
- versionMinor : int
- versionParts : list
- versionPatch : int

## Detailed Description

All other Qt modules have a dependency on the Qt.core module, and therefore you do not need to list it in your dependencies if you depend on at least one other Qt module.

Some of the Qt.core 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.

### Relevant 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 group.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.metatypes"` | n/a | 1.16 | This tag is attached to the JSON files that are potentially created if generateMetaTypesFile is enabled.
`"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.
`"mocable"` | - | 1.13 | Use this tag to force Qbs to run `moc` on the respective files, even though they do not contain `Q_OBJECT` or a related macro.
`"unmocable"` | - | 1.2 | Use this tag for files that Qbs should not run `moc` on, even though they contain `Q_OBJECT` or a related macro.

## Property Documentation

availableBuildVariants : stringList

The build variants that this Qt installation offers.

Default: Set by setup-qt.

binPath : path

The path in which Qt tools such as `qmake`, `moc`, and so on are located.

Default: Undefined

combineMocOutput : bool

Whether 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.

Default: cpp.combineCxxSources

config : stringList

Corresponds to the default value of qmake's `CONFIG` variable.

Default: `[]`

docPath : path

The path in which the Qt documentation is located.

Default: Undefined

enableBigResources : bool

Whether the Qt resource compiler is run in a two-pass fashion that supports the creation of big resources.

Default: `false`

enableKeywords : bool

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.

Default: `true`

frameworkBuild : bool

Whether Qt was built as a framework. This is only relevant for Darwin systems.

Default: Undefined

generateMetaTypesFile : bool

If this property is enabled, a JSON file tagged as `"qt.core.metatypes"` will potentially be generated from metatype information collected by `moc`.

Default: Undefined

This property was introduced in Qbs 1.16.

incPath : path

The base path of the Qt headers.

Default: Undefined

libInfix : string

The library infix can be set at Qt build time to change the name of Qt's libraries.

For example, if the infix is `"Test"`, on Unix systems, the Qt Core library will be in a file called `libQt5CoreTest.so` instead of the default `libQt5Core.so`.

Default: `[]`

libPath : path

The path in which the Qt libraries are located.

Default: Undefined

lreleaseMultiplexMode : bool

If this property is `true`, `lrelease` will merge all `.ts` files into one `.qm` file. Otherwise, one `.qm` file will be created for each `.ts` file.

Default: `false`

lreleaseName : string

The base name of the `lrelease` tool. Set this if your system uses a name such as `"lrelease-qt4"`.

Default: `"lrelease"`

metaTypesInstallDir : bool

The directory to install the metatypes file into. If this property is empty or undefined, the metatypes file will not be installed. If the generateMetaTypesFile property is not `true`, then this property has no effect.

Default: Undefined

This property was introduced in Qbs 1.16.

mkspecPath : path

The path in which the Qt `mkspecs` are located.

Default: Undefined

mocFlags : stringList

A list of additional flags to `moc`.

You will rarely need to set this property.

Default: `[]`

mocName : string

The base name of the `moc` tool.

Set this if your system uses a name such as `"moc-qt4"`.

Default: `"moc"`

namespace : string

The Qt namespace that can be set at build time via the `configure` script.

By default, Qt is not built in a namespace.

Default: Undefined

pluginMetaData : stringList

A list of additional plugin metadata.

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"]

Default: `[]`

pluginPath : path

The path in which the Qt plugins are located.

Default: Undefined

qdocEnvironment : stringList

The environment for calls to `qdoc`. Typically, you will need to set some variables here when running `qdoc` to build your project documentation.

Default: Undefined

qdocName : string

The base name of the `qdoc` tool.

Default: `"qdoc3"` for Qt 4, `"qdoc"` otherwise.

qmBaseName : string

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`.

Default: product.targetName

qtBuildVariant : string

Specifies the type of Qt libraries to build against: `"debug"` or `"release"`.

Note: On some systems, it is not possible to link code built in debug mode against libraries built in release mode and vice versa.

Default: 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.

qtConfig : stringList

Corresponds to the default value of qmake's `QT_CONFIG` variable.

Default: `[]`

resourceFileBaseName : string

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.

Default: product.targetName

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.

Default: `"/"`

resourceSourceBase : path

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.

Default: Undefined

staticBuild : bool

Whether Qt was built statically.

Default: Undefined

version : string

The Qt version.

Consists of three numbers separated by dots. For example "5.9.1".

Default: Undefined

versionMajor : int

The Qt major version.

Default: `versionParts[0]`

versionMinor : int

The Qt minor version.

Default: `versionParts[1]`

versionParts : list

The Qt version as a list.

For example, Qt version 5.9.1 would correspond to a value of `[5, 9, 1]`.

Default: `[]`

versionPatch : int

The Qt patch level.

Default: `versionParts[2]`