C

QmlProject API Reference (Technology Preview)

Introduction

qmlprojectexporter is a tool that allows the automatic generation of C++ code for all the resources and .qml files included in your project. The resources can be Qml files, Images, Font files, Translation files, and C++ interfaces. The main parameter the user needs to provide to qmlprojectexporter is a .qmlproject file. This file defines the project's structure and might depend on other .qmlproject module files.

qmlproject files

The syntax of .qmlproject file is based on the same syntax as Qml documents. They are used to describe the project structure. Similar to Qml documents, the .qmlproject files are composed of an import section followed by a hierarchy of Nodes or Objects, starting from the root Node (Project in this case), with each Node having a predefined set of properties. The import section consists mainly of "import QmlProject 1.3" which indicates that this is a .qmlproject file and specifies which version of the API should be used.

Nodes

Each Node configures a specific part of a project (Qml files, Images, Modules, among others). Some nodes can be defined multiple times in the Project root node, such as ImageFiles. Others should be defined only once, for example, MCU.Module.

Warning: Currently, the depth of the .qmlproject file hierarchy is two, meaning the Project node is the only one containing nodes. Other nodes can only define properties..

Properties

Properties in .qmlproject files can be considered as configuration parameters. Each node has a predefined set of configurations. Users can assign other configurations or properties from the MCU.Config node. When not found in its default Node (such as ImageFiles), those configuration properties are prefixed with "MCU.". For more information, see MCU.Config.

Nodes

Project

Project.importPaths

A list of paths where the extra header files live.

Project.mainFile

The main QML source file for the application.

Project.projectRootPath

The root path of the project

QmlFiles

QmlFiles.copyQmlFiles

Enables copying the QML files into the output directory

QmlFiles.directory

A directory contaning the QML files

QmlFiles.files

A list of QML files.

ImageFiles

ImageFiles.MCU.base

Defines the base path for the assets.

ImageFiles.MCU.prefix

Adds a common prefix to the file's URI.

ImageFiles.MCU.resourceCachePolicy

Defines the image cache policy.

ImageFiles.MCU.resourceCompression

Store image in compressed format.

ImageFiles.MCU.resourceImagePixelFormat

Set the preferred pixel format for the image assets.

ImageFiles.MCU.resourceOptimizeForRotation

Enable optimizations for rotating the image at runtime.

ImageFiles.MCU.resourceOptimizeForScale

Enable optimizations for scaling the image at runtime.

ImageFiles.MCU.resourceRuntimeAllocationType

Define the asset runtime allocation type.

ImageFiles.MCU.resourceStorageSection

Define the asset's storage section.

ImageFiles.directory

Adds a directory containing the image assets.

ImageFiles.files

A list of image assets.

FontFiles

FontFiles.MCU.addDefaultFonts

Adds the default font files from Qt for MCUs to the project.

FontFiles.directory

Adds all the font files in the given directory.

FontFiles.files

A list of the font files to be added.

TranslationFiles

TranslationFiles.MCU.omitSourceLanguage

Indicates whether to include or exclude source language strings.

TranslationFiles.directory

Adds a directory containing the translation files.

TranslationFiles.files

Adds the list of the translations files.

FontConfiguration

FontConfiguration.MCU.autoGenerateGlyphs

Generates glyphs automatically.

FontConfiguration.MCU.complexTextRendering

Enables rendering complex scripts

FontConfiguration.MCU.defaultFontFamily

Sets a default font family for Text items.

FontConfiguration.MCU.defaultFontQuality

Sets a default font quality for Text items.

FontConfiguration.MCU.fontCachePrealloc

Controls the font cache buffer preallocation.

FontConfiguration.MCU.fontCachePriming

Controls font cache priming.

FontConfiguration.MCU.fontCacheSize

Set maximum cache size used by font engine.

FontConfiguration.MCU.fontEngine

Selects a font engine for the project.

FontConfiguration.MCU.fontFilesCachePolicy

Controls font file caching.

FontConfiguration.MCU.fontFilesRuntimeAllocationType

Control copying pre-rasterized glyph data to RAM.

FontConfiguration.MCU.fontFilesStorageSection

Configures the resource storage section for the font files.

FontConfiguration.MCU.fontHeapPrealloc

Controls preallocation of the heap buffer used by the font engine.

FontConfiguration.MCU.fontHeapSize

Defines a maximum heap size for the font engine.

FontConfiguration.MCU.fontVectorOutlinesDrawing

Controls using vector outlines for text rendering.

FontConfiguration.MCU.glyphsCachePolicy

Defines a policy to copy pre-rasterized glyph data to RAM.

FontConfiguration.MCU.glyphsRuntimeAllocationType

Defines the runtime allocation type to be used to copy glyph data.

FontConfiguration.MCU.glyphsStorageSection

Configure the resource storage section used for pre-rasterized glyph data.

FontConfiguration.MCU.maxParagraphSize

Set the maximum paragraph size.

MCU.Config

MCU.Config.controlsStyle

Selects the style of the Qt Quick Controls.

MCU.Config.debugBytecode

Indicates if JavaScript bytecode should be included.

MCU.Config.debugLineDirectives

Indicates whether to add #line directives.

MCU.Config.maxResourceCacheSize

Defines the maximum resource cache size for a runtime allocation type.

MCU.Config.platformAlphaCompressedLosslessResourcePixelFormat

Defines a default format for lossless compression of the transparent image assets.

MCU.Config.platformAlphaPixelFormat

The default pixel format for transparent image assets.

MCU.Config.platformImageAlignment

Defines the minimum alignment for image data.

MCU.Config.platformOpaqueCompressedLosslessResourcePixelFormat

Defines a default pixel format for lossless compression of opaque image assets.

MCU.Config.platformOpaquePixelFormat

Defines a default pixel format for opaque image assets.

MCU.Config.platformPixelWidthAlignment

Defines required pixel alignment for images.

MCU.Config.resourceCachePolicy

Defines the image cache policy.

MCU.Config.resourceCompression

Indicates if the image assets are stored in compressed format.

MCU.Config.resourceImagePixelFormat

Defines a pixel format for rendering the image assets.

MCU.Config.resourceOptimizeForRotation

Enable optimizations for rotating the image at runtime.

MCU.Config.resourceOptimizeForScale

Enable optimizations for scaling the image at runtime.

MCU.Config.resourceRuntimeAllocationType

Define the asset runtime allocation type.

MCU.Config.resourceStorageSection

Defines the asset storage section.

MCU.Module

MCU.Module.generateQmlTypes

Generates a type information file for the module.

MCU.Module.uri

Defines a URI for the module.

ModuleFiles

ModuleFiles.MCU.qulModules

A list of Qt Quick Ultralite modules that the project should linked to.

ModuleFiles.directory

Adds a directory containing the QML module files.

ModuleFiles.files

Adds a list of the qmlproject files.

InterfaceFiles

InterfaceFiles.MCU.qmlImports

Lists the QML imports.

InterfaceFiles.directory

Provides a directory containing the C++ interface files.

InterfaceFiles.files

List the C++ interface files.

Commandlines

qmlprojectexporter

--boarddefaults

A path to BoardDefaults.qmlproject file holding default property values of a board.

--controls-style

Override controls style

--export-configuration

A flag to enable exporting configuration information for build systems.

--export-cpp

Enable exporting cpp sources.

--export-modules

Enable or disable exporting modules within a project.

--help

List the commandline parameters.

--include-dirs

Comma separated list of include dirs.

--outdir

The output directory.

--qml-mappings-dir

Specify the path where the mapping of custom qml modules to default modules are listed .

--resource-compiler

Path to rc.exe (for MSVC toolchain).

--toolchain

An identifier of the toolchain that will be used for compiling the generated files.

--update-translations

Enable updating the translation files.

--verbose

Print calls to other tools to standard output.

qmlprojectfile

The path to the qmlproject file.

Available under certain Qt licenses.
Find out more.