[Development] Request for early MOC support for C++20 Modules

Elias Steurer kelteseth at googlemail.com
Fri Dec 15 14:36:24 CET 2023


Hi Devs,

I'd like to ask about a possible roadmap update regarding C++20 modules 
support in moc. There was a discussion a while ago about C++20/23 
support for Qt 
(https://lists.qt-project.org/pipermail/development/2023-May/043823.html), 
and I would like to know if there has been any internal update. The 
corresponding bug report is https://bugreports.qt.io/browse/QTBUG-86697, 
but it seems that even more bump comments will not help. This is about 
ensuring moc can handle modules, not about converting Qt itself into a 
module. Getting moc ready for C++20 modules is something that could be 
done now, well in advance of Qt 6.9. For me, this is the only, and 
biggest, roadblock to adding modules support in my apps. Also, we 
shouldn't forget about tools like the QtRemoteObjects compiler that 
translates .rep files into .cpp/.h files (and possibly others?) that 
need updating too.

On a related note, when moving a class to modules, it would be handy to 
have a way to skip the 'Generate Missing Q_PROPERTY Members' boilerplate 
code. My current classes are mostly 50% getter/setter boilerplate, and 
in my opinion, this is only manageable because we split our code into 
header and source files. This will be gone when using modules. So, I 
would like to see something like *Q_PROP(QString text)*, that generates 
default get/set/notify code, and if needed, one could still use the old 
*Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged 
FINAL)* if they need to add additional logic into the get/set functions.

Cheers,
Elias Steurer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20231215/a779f145/attachment.htm>


More information about the Development mailing list