Qt

Qt

 

Qt is a cross-platform application development framework for desktop, embedded, and mobile.

Status

  • Qt builds with Long Term Support for Windows Arm64 begin from v6.8, released in October 2024.

    • Installers are available from their official website.

    • You can install it easily using aqt (does not need a Qt account)
      ./aqt.exe install-qt windows desktop 6.8.0 win64_msvc2019_arm64

  • Qt WebEngine, WebView, WebChannel can be built from source starting with Qt 6.9, with binary packages expected from Qt 6.10 (in beta at present).

    • Qt have certified support for components built from 6.9 or 6.10 with the LTS Qt 6.8 installation.

    • More details below.

  • Qt for Windows support for Arm architecture from Qt v6.2.

    • Builds prior to v6.8 are considered Technical Preview for Windows Arm64.

    • Technical Preview only provides cross compilation on x64 for WoA target.

    • Binaries are hosted here for 6.2.0.

  • Qt can be compiled with LLVM (clang-cl) and MSVC compiler.

    • Qt 6.2 has a known issue when compiled with MSVC.

    • Recommended to use Qt 6.3.1 and above if MSVC compiler is required.

  • Qt 5.15 can be built from sources (no binary available) by applying this patch and instructions (uses jom instead of cmake for build). Note: For native compilation, no patch is needed (only for cross compilation).

  • Qt support for Arm64EC is not available today.

Build from Source

Qt is most popularly installed as binary from their official download page, but may also be compiled from source. Community builds recommend MSYS2 for building Qt.

Install the MSYS2 build dependencies, needed for Qt :

pacman -S mingw-w64-x86_64-headers-git

Main commands to build from source on a windows arm64 machine

git clone https://code.qt.io/qt/qt5.git qt6 cd qt6 perl init-repository mkdir qt6-build cd qt6-build ..\configure.bat -prefix C:\path\to\install cmake --build . cmake --install .

Qt official build documentation could be found atQt for Windows - Building from Source | Qt 6.10

Binary Availability

Refers the Qt documentation page here: Qt for Windows | Qt 6.10 for the most up to date information. The page also has links to the Qt installer.

WebEngine for Qt 6.8

Qt 6.8.x does not contain the right Chromium version required to build WebEngine for Windows on Arm. The version of Chromium required with Windows on Arm support is 123 which is only available with Qt 6.9 that uses Chromium 130.x. So it’s not possible to compile Qt WebEngine from 6.8.x source on Windows on Arm. The Qt 6.9.0, which was released on April 2nd, contains support for Qt WebEngine on Windows on Arm in source code only. Binary packages will be provided starting with Qt 6.10 available at time of writing through the Qt installer for Qt 6.10 beta 1 (see here).

If you need Qt WebEngine for Qt 6.8.x, you should take the Qt 6.9.x (or later) source, compile it on top of a Qt 6.8.x build. Qt are planning to enable binary builds back to 6.9.x once the 6.10 has fully released.

Qt does not support Arm64EC

Qt 6.8 can be successfully compiled to target Arm64EC, however Qt signals can fail across module boundaries. This is caused by compiler code generation required specifically for Arm64EC that inserts a Fast Forward Sequence (FFS) ahead of functions that might be called from an x64 function. This can result in inconsistent function addresses when queried from different code locations. While this is a ‘by-design’ behaviour of the compiler and does not violate the ABI, it is different from the behaviour observed in either a pure x64 or Arm64 binary. Address consistency is assumed by Qt signals, and is used for indexing the list of signals.

The MSVC compiler supports a storage-class directive __declspec(hybrid_patchable) that can be used to always return the FFS address for the decorated type, which has the impact of generating address consistency. Note there is a small performance impact when calling FFS rather than directly to the Arm64EC function. Also note that each type must be individually decorated.

A number of options are being considered to allow Qt to support Arm64EC, although this is not expected in the short term.

Experiments have been successful in applying __declspec(hybrid_patchable) to impacted signal types for Arm64EC compilations of Qt applications, although the initial effort and ongoing maintenance is challenging. A second approach that has been successfully tested was to modify the meta-object compiler (MOC) code, specifically QtMocHelpers::indexOfMethod in qtbase/src/corelib/kernel/qtmochelpers.h to avoid the direct address comparison and consider the presence of an FFS.