[Development] QMetaMethod in Qt 6

Adam Light aclight at gmail.com
Thu May 28 17:43:14 CEST 2020


On Wed, May 27, 2020 at 8:51 AM Thiago Macieira <thiago.macieira at intel.com>
wrote:

> On Wednesday, 27 May 2020 03:42:19 PDT Oswald Buddenhagen wrote:
> > > this is not something we can subject our users to.
> >
> > orly? kde had been doing that for quite a while.
>
> 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.
>
> That said, we shouldn't enforce this.
>
>
On Windows, the way moc satisfies #includes is very slow, particularly when
many (32 in my case) moc processes are running concurrently. Since .cpp
files tend to result in many more included files, #including a .moc file
from a .cpp file as a regular practice could significantly increase build
times, and it also prevents an optimization I came up with that mitigates
the poor moc performance (see https://bugreports.qt.io/browse/QTBUG-81348 for
details).

As core count increases, moc's performance might impact more users, though
it may not be obvious to many of them. Changing Qt in a way that would
require #including the moc output from the .cpp file might cause noticeable
increase in build times unless moc is also changed.

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200528/e2f5ddf8/attachment.html>


More information about the Development mailing list