# Build Slicer using Qt6 on Win11

**URL:** https://discourse.slicer.org/t/build-slicer-using-qt6-on-win11/38068
**Category:** Development
**Tags:** build
**Created:** [August 28, 2024, 12:45am UTC](https://discourse.slicer.org/t/build-slicer-using-qt6-on-win11/38068 "2024-08-28T00:45:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![chz31](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chz31/32/77363_2.png) [@chz31](https://discourse.slicer.org/u/chz31)
#### Post date: [August 28, 2024, 12:45am UTC](https://discourse.slicer.org/t/build-slicer-using-qt6-on-win11/38068/1 "2024-08-28T00:45:31Z")

</div>

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](https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/windows.html#:~:text=cd%20C%3A%5CD%0A%0A%22C%3A%5CProgram%20Files%5CCMake%5Cbin%5Ccmake.exe%22%20%5E%0A%20%20%2DG%20%22Visual%20Studio%2017%202022%22%20%2DA%20x64%20%5E%0A%20%20%2DDQt5_DIR%3APATH%3DC%3A/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5%20%5E%0A%20%20%2DS%20C%3A%5CD%5CS%20%2DB%20C%3A%5CD%5CSR%0A%0A%22C%3A%5CProgram%20Files%5CCMake%5Cbin%5Ccmake.exe%22%20%2D%2Dbuild%20C%3A%5CD%5CSR%20%2D%2Dconfig%20Release). 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.

```auto
-- 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)

```

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [August 28, 2024, 1:32am UTC](https://discourse.slicer.org/t/build-slicer-using-qt6-on-win11/38068/2 "2024-08-28T01:32:09Z")

</div>

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:

> <https://github.com/Slicer/Slicer/issues/6388>
>
> Users are running into issues that are not going to be fixed on Qt5, therefore, …we need to switch to Qt6.
> 
> Issues reported by users that would be likely fixed by moving to Qt6:
> \- Proxy issues on mac (https://discourse.slicer.org/t/proxy-issue-in-extensions-manager/23467)
> 
> Unfortunately, Qt6 considerably raises minimum software and hardware requirements - see https://github.com/Slicer/Slicer/pull/6108

---

<div class="post-metadata">

### Author: ![chz31](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chz31/32/77363_2.png) [@chz31](https://discourse.slicer.org/u/chz31)
#### Post date: [August 28, 2024, 3:22am UTC](https://discourse.slicer.org/t/build-slicer-using-qt6-on-win11/38068/3 "2024-08-28T03:22:05Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [August 28, 2024, 8:19am UTC](https://discourse.slicer.org/t/build-slicer-using-qt6-on-win11/38068/4 "2024-08-28T08:19:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![chz31](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chz31/32/77363_2.png) [@chz31](https://discourse.slicer.org/u/chz31)
#### Post date: [August 28, 2024, 4:59pm UTC](https://discourse.slicer.org/t/build-slicer-using-qt6-on-win11/38068/5 "2024-08-28T16:59:39Z")

</div>

Thanks! I’ll give it try.
