Skip to content

Qt6 compatibility patch 1#396

Merged
mrkite merged 1 commit into
mrkite:masterfrom
Kolcha:qt6-compat-patch-1
May 10, 2026
Merged

Qt6 compatibility patch 1#396
mrkite merged 1 commit into
mrkite:masterfrom
Kolcha:qt6-compat-patch-1

Conversation

@Kolcha
Copy link
Copy Markdown
Contributor

@Kolcha Kolcha commented Apr 27, 2026

  • 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.

@Kolcha
Copy link
Copy Markdown
Contributor Author

Kolcha commented Apr 27, 2026

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.

@EtlamGit
Copy link
Copy Markdown
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.
@Kolcha Kolcha force-pushed the qt6-compat-patch-1 branch from 824564e to e97d7ef Compare April 28, 2026 08:50
This was referenced Apr 28, 2026
@EtlamGit
Copy link
Copy Markdown
Collaborator

Just some comments to keep you motivated:

  • I still struggle with the Qt6 license terms and it feels wrong for me to use Qt6 in the current state.
  • Nevertheless making the code compatible with Qt5 and Qt6 is perfectly fine and good coding practice.
  • My spare time is extremely limited and the time budget for Minutor is mostly consumed by compatibility fixes and version updates. Therefore it might take many weeks, sometimes even until next big vacation period that I will find time to take a look into topics I do not like that much.

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 ;-)
I really appreciate your effort to improve code quality!

@mrkite mrkite merged commit ee55f0b into mrkite:master May 10, 2026
6 checks passed
@Kolcha Kolcha deleted the qt6-compat-patch-1 branch May 11, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants