C
Qt Quick Ultralite Platform Exporter
Since Qt for MCUs 2.8, some functionality has been removed from the platform exporter tool. This tool is no longer supposed to be used directly by customers. Use the qmlprojectexporter instead.
The following table shows which platform exporter options translate into qmlprojectexporter options.
platformExporter | qmprojectexporter |
---|---|
--builddir | --qul-build-dir |
--outputformat | --project-type |
--sdkdir | --board-sdk |
--includeIDEgeneratedHWCode | --include-ide-generated-hw-code |
--IDEsourcesdir | --ide-sources-outdir |
--outdir | --platform-outdir |
Example for exporting a platform use the qmlprojectexporter:
qmlprojectexporter --platform <platform> --toolchain <toolchain> --no-export-qml --qul-source-dir <QulDir> --qul-build-dir <BuildDir> --project-type <type> --board-sdk <boardSdk> --platform-outdir <exportDir> --include-ide-generated-hw-code --ide-sources-outdir <outdir_for_3rdparty_sources>
Integrate Qt for MCUs into your project
This is an example main.cpp
to show the code that is required to integrate the exported UI and platform sources into your project.
#include "minimal.h" #include <qul/application.h> #include <qul/qul.h> int main() { Qul::initHardware(); Qul::initPlatform(); Qul::Application _qul_app; static struct ::minimal _qul_item; _qul_app.setRootItem(&_qul_item); #ifdef APP_DEFAULT_UILANGUAGE _qul_app.setUiLanguage(APP_DEFAULT_UILANGUAGE); #endif _qul_app.exec(); return 0; }
IDE settings
Follow these steps to integrate the exported source to a 3rd party IDE or build system. For projects using CMake or the GHS Mutli IDE, these are supported directly.
For any other IDE follow the steps below manually.
- Add the exported platform and application source files to your project in the IDE.
- Add assembly source files to the sources list of your project. Passing
--toolchain GNU
to the qmlprojectexporter enables generates binary files (incbin) for resources. In that case,qul_font_files_loader.S
andqul_assets.S
need to be added to the sources. This option only applies to GNU GCC compilers. For other compilers, resources are generated as C++ arrays. - Add board files which include pin muxing, clock configuration, and hardware initialization code.
You can add these files using one of the following options:
- Custom board files can be generated with MCU vendor tools such as STM32 CubeMX or NXP MCUXPresso config tools.
- Use
--include-ide-generated-hw-code
with the platform exporter to export board files provided by Qt for MCUs for the reference boards. You can also specify a target directory using the--ide-sources-outdir <folderpath>
option.
For example:
<QUL_DIR>/bin/qmlprojectexporter.exe \ --platform-metadata <BUILD_DIR>/lib/QulPlatformTargets_<PLATFORM_NAME>-export.json \ --project-type cmake \ --no-export-qml \ --outdir <DESTINATION_FOLDER> \ --platform-build-dir <BUILD_DIR> \ --include-ide-generated-hw-code \ --ide-sources-outdir <IDE_PROJECT_ROOT_DIR>/board
- Add include paths, pre-defines, and toolchain flags.
The
<PLATFORM_EXPORT_DIR>/IDE-Import-Instructions.txt
file lists all the required compiler and linker settings for the project. This includes architecture flags, include paths, and preprocessor defines for toolchain in use. - Add path to the exported linker script in the project linker settings.
Linker scripts for the Qt Quick Ultralite application require custom sections to be defined for resource data and caches. The exported linker scripts from the Platform Exporter tool can be used directly in the IDE.
For ARMGCC:
<QUL_EXPORT_FOLDER>/platform/boards/nxp/<board>/cmake/armgcc/<linker_file>.ld
For IAR:<QUL_EXPORT_FOLDER>/platform/boards/nxp/<board>/cmake/iar/<linker_file>.icf
- Add the following prebuilt Qt Quick Ultralite libraries to the linker settings:
- <BUILD_DIR>/libQulCore_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulControls_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulPNGDecoderLodePNG_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulPNGDecoderNull_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulShapes_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulControlsTemplates_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulTimeline_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulMonotypeUnicodeEngineShaperDisabled_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
- <BUILD_DIR>/libQulMonotypeUnicode_<ARCHITECTURE>-<COMPILER>-<BUILD_TYPE>.a
Additional information
QUL_STD_STRING_SUPPORT CMake option
The architecture requires using the QUL_STD_STRING_SUPPORT
CMake option while configuring your project, if the core library was built with it. Otherwise the application crashes.
Available under certain Qt licenses.
Find out more.