[Development] QMetaMethod in Qt 6

Edward Welbourne edward.welbourne at qt.io
Thu May 28 11:32:41 CEST 2020

>>>> this is not something we can subject our users to.

On Wednesday, 27 May 2020 03:42:19 PDT Oswald Buddenhagen wrote:
>>> orly? kde had been doing that for quite a while.

On 2020 May 27, at 17:50, Thiago Macieira <thiago.macieira at intel.com> wrote:
>> And I fixed QtCore to do the same.
>> The only reason not to include the moc output in your .cpp is if you
>> don't have one (a header-only class whose only non-inline methods are
>> the moc- generated ones). Otherwise, #include your mocs.

Shawn Rutledge (28 May 2020 11:06)
> The reason is to speed up compilation, right?  Is there another reason?

Yes, see earlier in this thread: if you #include your .moc in your .cpp,
your .h can get away with forward-declaring some classes whose headers
it doesn't #include; the .moc may need to see the actual definition,
rather than a forward declaration, and the .cpp shall do the needed
#include, hence make the definition visible, which the .moc then
benefits from by being #included in the .cpp.


More information about the Development mailing list