Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds Qt6 support to the CTKAppLauncher project while maintaining backward compatibility with Qt5. The changes allow the project to be built with either Qt5 or Qt6, with automatic detection based on which Qt version is available.
Changes:
- Updated CMake build system to support both Qt5 and Qt6, with automatic version detection based on Qt6_DIR
- Replaced Qt5-specific CMake macros with version-agnostic alternatives (qt_wrap_cpp, qt_wrap_ui, qt_add_resources)
- Updated header files to include QStringList directly instead of forward declaring it for Qt6 compatibility
- Conditionally compiled QProcess::setupChildProcess() to only build for Qt < 6.0.0 since it was removed in Qt6
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Added Qt6 version detection, updated version validation to accept both 5 and 6, and made find_package calls version-agnostic |
| CMake/ctkMacroBuildLib.cmake | Replaced Qt5-specific macros (QT5_WRAP_CPP, etc.) with version-agnostic alternatives (qt_wrap_cpp, etc.) |
| Base/ctkSettingsHelper.h | Changed QStringList from forward declaration to direct include for Qt6 compatibility |
| Base/ctkAppArguments.h | Changed QStringList from forward declaration to direct include for Qt6 compatibility |
| Base/ctkAppLauncher_p.h | Added preprocessor guard to conditionally declare setupChildProcess() only for Qt < 6.0.0 |
| Base/ctkAppLauncher.cpp | Added preprocessor guard to conditionally define setupChildProcess() only for Qt < 6.0.0 |
| Base/Testing/Cpp/CMakeLists.txt | Updated version check condition to accept both Qt5 and Qt6, but left Qt5-specific macro unchanged (bug) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
@jcfr since this repo depends on https://github.com/jcfr/qt-static-build
|
Extend the AppLauncher library to build against both Qt5 and Qt6 while
keeping Qt5 behavior unchanged.
- Allow CTKAppLauncher_QT_VERSION to be 5 or 6 (defaulting to 6 when
Qt6_DIR is provided) and validate the value explicitly.
- Switch from Qt5-specific macros (QT5_WRAP_*) to qt_wrap_cpp,
qt_wrap_ui, and qt_add_resources so the same build logic works with
Qt5 and Qt6.
- Use Qt${CTKAppLauncher_QT_VERSION} in find_package() and
QT_LIBRARIES to avoid pulling in Qt5 targets in a Qt6 build.
- Guard ctkInteractiveProcess::setupChildProcess() so it is only
declared/defined for Qt5, preventing signature conflicts with the
Qt6 QProcess API.
- Include <QStringList> directly instead of relying on forward
declarations for improved compatibility.
This resolves Qt major version mismatches when CTKAppLauncherLib is
consumed from Qt6-based projects such as Slicer.
Co-authored-by: Andras Lasso <lasso@queensu.ca>
Co-authored-by: James Butler <james.butler@revvity.com>
6019e1f to
f66a751
Compare
1 task
Contributor
|
@jcfr Do you have thoughts on the mentioned items in my previous comment about proceeding further on the Qt6 work here? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.