Il 06/12/19 09:42, Uwe Rathmann ha scritto:
Something you can try is to include the moc file at the end of your cpp file. This can be done like this:#include "moc_XYZ.cpp" This type of construction is at least supported by qmake. This does not reduce the number of moc runs, but it reduces the number of compiler runs. As a rule of thumb for not too large classes I would expect, that ~50% of the compile time is spent inside the Qt headers and by including the moc file the overall compile time goes down by 33% as the headers need to be processed only once.
This trick is used in several places in Qt itself (look for "includemoc" in commits). Not only it helps build times but also it produces slightly better code overall.
HTH, -- Giuseppe D'Angelo | giuseppe.dang...@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
smime.p7s
Description: Firma crittografica S/MIME
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest