Qt6 compatibility patch 1#396
Merged
Merged
Conversation
Contributor
Author
|
Qt6 migration plan is to use Qt5 compatibility module, so no "intrusive changes" assumed (but still some changes are required). both Qt5 and Qt6 will be supported after migration. changes will be introduced gradually. |
Collaborator
|
All your point sound very useful, will try to look into the changes when I find some time. |
- added missing includes some implicit dependencies allowed to build successfully, but with Qt6 these dependencies has changed. also it is a good practice to include what is used. - don't use Qt module in some includes QAction is in QtGui in Qt6, but in QtWidgets in Qt5, just drop module name from include, use raw QAction. - use `auto` for some iterator due to type mismatch looks like there was QMap -> QMultimap change without updating iterator type where it was created, but Qt5 was ok with this (a bit weird, but still). with Qt6 iterator types became incompatible (expected). since C++11 it is possible to use `auto`, and using it for iterator types is a common practice. project uses C++14, so using `auto` here is a good option. - put C++17 compatibility stuff behind proper define guard project uses C++14 and has some stuff implemented that available in C++17. Qt6 requires C++17, so 2 implementations cause build issues. also it is a good practice to include compatibility stuff conditionally. - adjusted .gitignore to handle modern Qt Creator layout Qt Creator creates `.qtcreator` directory to store project- specific information, and `build` for the build products. these changes don't make build with Qt6 possible, but they don't hurt Qt5 build either, and still move Qt6 migration forward.
824564e to
e97d7ef
Compare
This was referenced Apr 28, 2026
EtlamGit
approved these changes
May 10, 2026
Collaborator
|
Just some comments to keep you motivated:
So: Do not get demotivated when you do not receive any feedback. Just place a ping in the PR every month to poke me. Also try to make smaller PRs with good explanation, because that reduces the review time. It seems that you tried that tactic this time, as this PR is a perfect example for that ;-) |
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.
added missing includes
some implicit dependencies allowed to build successfully, but with Qt6 these dependencies has changed. also it is a good practice to include what is used.
don't use Qt module in some includes
QAction is in QtGui in Qt6, but in QtWidgets in Qt5, just drop module name from include, use raw QAction.
use
autofor some iterator due to type mismatchlooks like there was QMap -> QMultimap change without updating iterator type where it was created, but Qt5 was ok with this (a bit weird, but still). with Qt6 iterator types became incompatible (expected). since C++11 it is possible to use
auto, and using it for iterator types is a common practice. project uses C++14, so usingautohere is a good option.put C++17 compatibility stuff behind proper define guard
project uses C++14 and has some stuff implemented that available in C++17. Qt6 requires C++17, so 2 implementations cause build issues. also it is a good practice to include compatibility stuff conditionally.
adjusted .gitignore to handle modern Qt Creator layout
Qt Creator creates
.qtcreatordirectory to store project- specific information, andbuildfor the build products.these changes don't make build with Qt6 possible, but they don't hurt Qt5 build either, and still move Qt6 migration forward.