r/cpp • u/Kelteseth • 23h ago
Qt moc now can handle basic C++ modules (Qt 6.12)
codereview.qt-project.org
•
Upvotes
moc: Properly handle modules
When moc'ing module interfaces and partitions, we make the generated cpp
file part of the respective module.
We do not support Q_OBJECT & friends in implementation units and private
module fragments, as our generated source file will not have access to
the respective classes, and we certainly do not want to carry over our
file inclusion hacks into the module world.
[ChangeLog][moc] moc now supports C++ modulesmoc: Properly handle modules
Note there is still a lot of work to be done: https://codereview.qt-project.org/c/qt/qtbase/+/767846 and I can't seem to find the PR where they fixed some qtbase code to make it work with modules. I guess most other qt modules will need some small fixes to work with modules as well.