Build Slicer using Qt6 on Win11

Hi all,

Does Slicer build on Windows support Qt6? I could not find Qt 5 install online. I tried to set Qt locations following the instruction. I simply updated Qt 5 to Qt6_DIR. It reported a Qt5.15 not found error (paste below) in CMake/SlicerBlockFindQtAndCheckVersion.cmake I manually updated all Qt5 in slicer_source/CMake/SlicerBlockFindQtAndCheckVersion.cmake to Qt6, but it appears that there are many cmake files that looked for Qt5.

Are there particular version of Slicer repository for Qt6 or are there easy way to update the cmake files to use Qt6? Somehow I could build Slicer on my personal laptop on WSL2 Ubuntu 22.04.

-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find Qt6XmlPatterns (missing: Qt6XmlPatterns_DIR)
CMake Warning at CMake/SlicerBlockFindQtAndCheckVersion.cmake:22 (find_package):
  Found package configuration file:

    C:/Qt/6.7.2/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake

  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find required Qt component "XmlPatterns".

  Expected Config file at
  "C:/Qt/6.7.2/msvc2019_64/lib/cmake/Qt6XmlPatterns/Qt6XmlPatternsConfig.cmake"
  does NOT exist



  Configuring with --debug-find-pkg=Qt6XmlPatterns might reveal details why
  the package was not found.

  Configuring with -DQT_DEBUG_FIND_PACKAGE=ON will print the values of some
  of the path variables that find_package uses to try and find the package.

Call Stack (most recent call first):
  CMake/SlicerBlockFindQtAndCheckVersion.cmake:67 (__SlicerBlockFindQtAndCheckVersion_find_qt)
  CMakeLists.txt:698 (include)


CMake Error at CMake/SlicerBlockFindQtAndCheckVersion.cmake:30 (message):
  error: Qt 5.15 was not found on your system.You probably need to set the
  Qt6_DIR variable.
Call Stack (most recent call first):
  CMake/SlicerBlockFindQtAndCheckVersion.cmake:67 (__SlicerBlockFindQtAndCheckVersion_find_qt)
  CMakeLists.txt:698 (include)

As of right now there is not Qt6 support for Slicer with Qt 5.15 being the latest known working version. You can follow progress on the task at:

Thanks for the information Is there anyway I can download Qt5.15? It appears that the online installer only has qt > 6.5 (it did have an option of qt5 compatibility though).

I remember something like having to check “Archives” or something similar in the installer app for the 5.x versions to show. It is still there, please look around a bit more.

2 Likes

Thanks! I’ll give it try.