[Interest] porting to Qt 5.4 - MOC very slow on Windows
André Pönitz
apoenitz at t-online.de
Fri Jan 16 20:46:20 CET 2015
On Fri, Jan 16, 2015 at 12:00:53PM +1100, Hamish Moffatt wrote:
> On 15/01/15 19:23, Koehne Kai wrote:
> > IIRC moc in Qt 5 got much more accurate in the parsing phase, which
> > might mean it now parses included headers that it previously missed.
> >
> > 2 - 3 seconds is quite long though ... Maybe running procmon.exe to
> > monitor all file accesses done by moc gives you a hint?
>
> Good suggestion. I've found that MOC is spending a lot of time searching
> for headers. [...]
An observation which might, or might not, help you: With Qt5 style
connects(), the need to use moc at all has greatly dimished:
Essentially, most private slots, and a large part of public slots
in an application can nowadays be normal, unqualified functions.
If the use of such slots is the only reason to have Q_OBJECT in a class
the Q_OBJECT, and consequently the moc run, can be avoided.
Andre'
PS: Other features that seem to lose quite a bit of their traditional
value in a Qt5/C++11 world are QSignalMapper and QAction::data()
More information about the Interest
mailing list