-
Notifications
You must be signed in to change notification settings - Fork 86
[patched-9] Port to Qt6, update for C++17/20, and improve compiler/platform support #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hjmjohnson
wants to merge
339
commits into
commontk:patched-9
Choose a base branch
from
hjmjohnson:slicer-2025-06-13-a2687828
base: patched-9
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[patched-9] Port to Qt6, update for C++17/20, and improve compiler/platform support #90
hjmjohnson
wants to merge
339
commits into
commontk:patched-9
from
hjmjohnson:slicer-2025-06-13-a2687828
Conversation
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
* replace qSort and qStableSort by std::stable_sort and std::sort
This completes the qSort handling in generator/ including related changes caused by the removal of QSet<>::toList() and QSet<>::fromList() in Qt6 (obsoleted in Qt5.14).
- replaced it and added backwards compatibility
- provides compatibility with the removal of the global ::endl for use with QTextStream; Qt6 requires Qt::endl - includes Qt6 specific changes necessary to deal with the replacement of QTextCodec by QStringConverter and the slight changes to the default setup of QTextStream (to UTF-8 with auto-detect of UTF-16) --------- Signed-off-by: John Bowler <[email protected]>
The warnings are already only emitted with GCC so changing them to the GCC diagnostic pragma is safe.
- works around the need to rewrite the XML parser in generator/typesystem.cpp by invoking the Qt5 compatibility library; this is the only thing in the generator which requires it but the alternative is a complete rewrite of the XML reading code
- parses constexpr (in the manner of const) and decltype (in the manner of __typeof) and adds flags for them
These changes use the new and existing support inside the parser to handle constexpr in Qt6 files and to ignore (with a warning) 'auto' functions.
Also add the alternate types that are available in Qt5 to replace the types deprecated in Qt5.14 (allows Qt5.15LTS users to make changes for compatibility with Qt6.)
- a previous fix for Qt5.12 breaks pythonqt_generator for 5.11 - includes better checking for precompiled headers and errors out early rather than failing when linking the src/ with mysterious missing symbols.
Expand all the tabs in non-binary source files
This is a minimal change to give the three anonymous structs used in the generator names so that the code conforms to the existing C++ standards.
This adds 'context' to ReportHandler warning messages; just a string saying what is being done.
In some places the list was sorted by pointer (resulting in a random sort) in other cases by name, sometimes with stable_sort, sometimes not. Now sort by name and maintain do a stable_sort.
const_iterators and other iterators became visible to the generator with changes in Qt5.14. This removes the corresponding iterators from the affected classes.
- also fix minor readme error
also fixed some warnings
this way we can avoid some parser errors. This is implemented by looking for matching braces. I hope there is no case where unmatched braces are allowed (strings and comments should be handled by the tokenizer).
…lity Update all references from `QVariant::Type` to `QMetaType::Type` across the generated files for improved alignment with Qt's data type handling.
Add conditional checks for the `verbose` flag to distinguish between legacy `Py_VerboseFlag` `Py_OptimizeFlag` and modern `sys.verbose` usage, ensuring compatibility with Python versions 3.11 and later. • Python is moving away from global interpreter state. • Use of global variables like Py_VerboseFlag is not thread-safe. • Python 3.12+ removes or restricts access to such globals in favor of per-interpreter APIs.
1240594
to
48dd28f
Compare
@hjmjohnson I suspect all the merge conflicts here arise from @jcfr ’s own CMake implementation compared to the other developer that issued a CMake infrastructure PR. As well as @jcfr’s back porting of many commits from the upstream to the CTK patched-9 branch. |
Thanks @hjmjohnson 🙏 , this positioned ourselves well. I will know work on consolidating the changes 🚀 |
bfaec20
to
d384f36
Compare
e9b1acf
to
5c189da
Compare
Rename so that the important installed package is named PythonQt (instead of Core).
Configure so that other builds can find PythonQt with find_package
add src/PythonQt_QtBindings.cpp add src/PythonQt_QtBindings.h
0e1c89b
to
2c6f7fc
Compare
…er versions Py_HashPointer() is not available in Python 3.12. It was only added to the public C-API in Python 3.13 (see the “What’s New in 3.13” notes) Release Status of a pointer-hash helper ≤ 3.12 Only the private, internal function _Py_HashPointer() exists. It is not exported in the limited- or stable-ABI headers and may disappear or change without notice. 3.13+ Py_HashPointer(const void *ptr) becomes a public API entry in <Python.h>.
7923b70
to
a2ba4af
Compare
a2ba4af
to
d809165
Compare
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.
A summary of all changes from mevislab/master to the current HEAD (slicer-2025-06-13-a2687828):
These changes collectively modernize the codebase, improve compatibility with recent Qt and C++ standards, and enhance maintainability.