--- a/cMake/FreeCAD_Helpers/SetupQt.cmake
+++ b/cMake/FreeCAD_Helpers/SetupQt.cmake
@@ -13,6 +13,10 @@
     elseif (FREECAD_QT_MAJOR_VERSION EQUAL 6)
         list (APPEND FREECAD_QT_COMPONENTS GuiTools)
         list (APPEND FREECAD_QT_COMPONENTS SvgWidgets)
+        if(WIN32)
+          set(QT_NO_PRIVATE_MODULE_WARNING ON)
+          list(APPEND FREECAD_QT_COMPONENTS GuiPrivate)
+        endif()
     endif()
 
     list (APPEND FREECAD_QT_COMPONENTS OpenGL PrintSupport Svg UiTools Widgets LinguistTools)
