[Development] QMetaMethod in Qt 6

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Thu May 28 22:13:56 CEST 2020


On 5/28/20 8:21 PM, Matthew Woehlke wrote:
>> if a .cpp file has a #include "myclass.moc" type statement, that .cpp
>> file has to be processed by moc
> Huh?*Why*?

A direct use case of this is to support having Q_OBJECT classes defined 
in a .cpp file. That requires moc to parse foo.cpp file and produce foo.moc.

The question is, does this happen unconditionally when a #include 
"foo.moc" appears a .cpp, even if that .cpp is not using Q_OBJECT & 
friends? Why would it be necessary in this case?

My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200528/98a0d434/attachment.bin>


More information about the Development mailing list