Is your feature request related to a problem? Please describe.
CTK_USE_QTTESTING is currently disabled for Qt 6 builds because the CTK-side QtTesting integration depends on Qt XmlPatterns, which is not available in Qt 6. As a result:
-
Projects building CTK with Qt 6 cannot enable QtTesting-based recording/replay and regression tests.
-
CTK’s QtTesting integration does not reflect the actual upstream dependencies:
- Qt XmlPatterns C++ classes are only used by
ctkXMLEventSource in CTK/Libs/QtTesting.
- Other XmlPatterns usages are limited to components such as
CTK/Libs/CommandLineModules and CTK/Applications/ctkCommandLineModuleExplorer, which are not required by all CTK consumers.
- The upstream QtTesting library (
commontk/QtTesting1) itself does not depend on Qt XmlPatterns.
-
This creates an unnecessary limitation for Qt 6 adopters who rely on QtTesting workflows.
Describe the solution you'd like
Make CTK_USE_QTTESTING=ON supported when building with Qt 6 by:
-
Aligning CTK’s QtTesting integration with the upstream QtTesting library so it no longer requires Qt XmlPatterns for core functionality.
-
Refactoring or isolating ctkXMLEventSource and any XmlPatterns-based logic so that:
- XmlPatterns is only used in Qt 5 builds (if needed), or
- XmlPatterns-dependent code is replaced with Qt 6–compatible XML handling.
-
Updating the CMake configuration so that:
CTK_USE_QTTESTING is not forcibly disabled for Qt 6 once dependencies are addressed.
- Appropriate Qt 6 modules (e.g.,
Qt6::Test) are used when QtTesting is enabled.
-
Preserving behavior and configuration for existing Qt 5 users.
Describe alternatives you've considered
- Keeping
CTK_USE_QTTESTING permanently disabled for Qt 6:
- Simple, but prevents users from leveraging QtTesting with modern Qt versions.
Additional context
- CTK now supports building with Qt 5 or Qt 6 via
CTK_QT_VERSION.
- As part of Qt 6 enablement,
CTK_USE_QTTESTING is currently forced OFF for Qt 6 to avoid unsupported Qt modules.
- Prior work in Slicer already narrowed
XmlPatterns usage to QtTesting-specific paths and optional components, indicating that a clean separation is feasible.
- This feature would restore QtTesting-based regression and UI testing workflows for projects migrating to Qt 6 while maintaining compatibility with existing Qt 5 setups.
Is your feature request related to a problem? Please describe.
CTK_USE_QTTESTINGis currently disabled for Qt 6 builds because the CTK-side QtTesting integration depends on Qt XmlPatterns, which is not available in Qt 6. As a result:Projects building CTK with Qt 6 cannot enable QtTesting-based recording/replay and regression tests.
CTK’s QtTesting integration does not reflect the actual upstream dependencies:
ctkXMLEventSourceinCTK/Libs/QtTesting.CTK/Libs/CommandLineModulesandCTK/Applications/ctkCommandLineModuleExplorer, which are not required by all CTK consumers.commontk/QtTesting1) itself does not depend on Qt XmlPatterns.This creates an unnecessary limitation for Qt 6 adopters who rely on QtTesting workflows.
Describe the solution you'd like
Make
CTK_USE_QTTESTING=ONsupported when building with Qt 6 by:Aligning CTK’s QtTesting integration with the upstream QtTesting library so it no longer requires Qt XmlPatterns for core functionality.
Refactoring or isolating
ctkXMLEventSourceand any XmlPatterns-based logic so that:Updating the CMake configuration so that:
CTK_USE_QTTESTINGis not forcibly disabled for Qt 6 once dependencies are addressed.Qt6::Test) are used when QtTesting is enabled.Preserving behavior and configuration for existing Qt 5 users.
Describe alternatives you've considered
CTK_USE_QTTESTINGpermanently disabled for Qt 6:Additional context
CTK_QT_VERSION.CTK_USE_QTTESTINGis currently forcedOFFfor Qt 6 to avoid unsupported Qt modules.XmlPatternsusage to QtTesting-specific paths and optional components, indicating that a clean separation is feasible.Footnotes
https://github.com/commontk/QtTesting ↩