Windows 快速入门


This topic provides instructions to compile a Qt Quick Ultralite project for Qt Desktop. The Qt Desktop environment lets you quickly preview the application you are developing, making the process of creating the application faster.

As a reference project let's use the thermostat demo provided with Qt for MCUs.


Currently, Windows 10 64bit is the only supported development host environment. Additionally, you must have the following tools installed, to build any Qt Quick Ultralite project:

  • MSVC++ compiler v14.16 (Visual Studio 2017 15.9) up to v14.26 (Visual Studio 2019 16.6)
  • CMake 3.15 or newer (you can install it using the Qt Online installer)

In addition, install Qt for MCUs using the Qt online installer that is available for download on Qt account .

Important: This guide uses <INSTALL_ROOT> as the reference to directory the Qt for MCUs is installed in.



To configure the project, use the CMake command from the command line. First, navigate to the <INSTALL_ROOT>\demos\thermo folder and enter the following commands:

C:\Users\John> set Qul_DIR=<INSTALL_ROOT>
C:\Users\John> cd %Qul_DIR%\demos\thermo
<INSTALL_ROOT>\demos\thermo> mkdir build_winqt
<INSTALL_ROOT>\demos\thermo> cd build_winqt
<INSTALL_ROOT>\demos\thermo\build_winqt> cmake .. -DQUL_PLATFORM=Qt -Ax64

The above commands will check the prerequisites and create the build setup, which includes generating visual studio project files.


To build, use the following command:

<INSTALL_ROOT>\demos\thermo\build_winqt> cmake --build . --target thermo_big --config Release


Once the thermostat application is built, try to run it. As it is built as a Qt application for Windows, it requires the Qt runtime libraries in the PATH . Qt for MCUs does not require you to install the standard Qt for desktop, instead it provides you with all the necessary libraries. You must ensure that these libraries are in your PATH .

<INSTALL_ROOT>\demos\thermo\build_winqt> set PATH=%Qul_DIR%\bin;%PATH%

Now we can run the application:


The Thermostat application window should look like this:

Visual Studio


To configure the project, follow instructions in the 命令行设置 章节。

在 Visual Studio 中打开解决方案

To work with your project using Microsoft Visual Studio, open the solution created by CMake from the build_winqt 文件夹。

Now, you should see the solution tree structure.

As this is a Windows Qt project, it requires Qt's runtime libraries to run. To make them available for the built application, you must set the runtime environment. To do this:

  1. Right-click on your project and select 特性 from the context menu.
  2. 点击 General > Debugging
  3. To Environment add the PATH variable pointing to the directory containing the Qt libraries. Those should be located inside the bin folder of your Qt for MCUs install root, for example:

After this step (assuming %Qul_DIR% was set to C:\QtForMCU\1.1.0) the project properties window should look like this:

构建 & 运行

Apply the changes, build the application, and run it. You should see on the screen the 恒温器演示 .

Qt Creator 设置

The following sections provides instructions to set up Qt Creator for Qt for MCUs development on the Windows platform only. For details about configuring Qt Creator for development on MCU boards, refer to Qt Creator 文档编制 .

配置 Qt Creator IDE

To develop for MCUs using the Qt Creator IDE, the MCU plugin is required. The Qt online installer enables it by default when you install the Qt for MCUs SDK.

To enable or disable the plugin, follow these instructions:

  1. 选择 Help > About Plugins and choose the MCU Support plugin from the list.
  2. Restart Qt Creator to apply changes

To build and run your application on MCUs, you must create a kit:

  1. 选择 Tools > Options > Devices > MCU
  2. If not already set, provide the path to the Qt for MCUs installation directory.
  3. Select a Target supported by the Qt for MCUs SDK 。例如, Qt for MCUs 1.7 - Desktop .
  4. 要求 section, ensure that the platform-specific requirements are met.
  5. 选择 Automatically create kits for all available targets on start to create kits automatically.

    注意: You could also manually create/remove kits using Create Kit and Remove Kit .

  6. 点击 Apply and restart Qt Creator if you choose to create kits automatically.

注意: Automatically create kits for all available targets on start option is available from Qt Creator v4.14 onwards. On older versions of Qt Creator, you have to explictly create or remove kits using Create kit or Remove kit .



  1. 选择 文件 > 打开文件或工程...
  2. 打开 CMakefiles.txt 文件从 thermo 文件夹。
  3. 选择 Qt for MCUs 1.7 - Desktop kit.
  4. 点击 配置工程 to finish.

The project should be configured.

Now, you are ready to go!

注意: For more information, refer to the Qt Creator 手册 .


You can debug the C++ code generated from your application using the Qt Creator or Microsoft Visual Studio. To make debugging a bit easier, in the generated code you will see snippets of the QML, from which the C++ code was generated.