Version: unspecified (using Devel) OS: Linux It happens when none of the moc files are included (automoc generates them because of Q_OBJECT) *AND* the output _automoc.cpp file does not exists yet (first run or after "make clean"). mocDefinitions is read from the _automoc.cpp.files file by lazyInitMocDefinitions(), which is called if the output file exists to check if the definitions have changed or the first time generateMoc() is called. When there are only not-included mocs in a project, the first call to generatedMoc() occurs after the mocDefinitions have been written in the output file. ---------------------------------------------- // run moc on all the moc's that are #included in source files QHash<QString, QString>::ConstIterator end = includedMocs.constEnd(); QHash<QString, QString>::ConstIterator it = includedMocs.constBegin(); for (; it != end; ++it) { generateMoc(it.key(), it.value()); } QByteArray automocSource; QTextStream outStream(&automocSource, QIODevice::WriteOnly); outStream << "/* This file is autogenerated, do not edit\n" << mocDefinitions.join(QString(QLatin1Char(' '))) << "\n*/\n"; if (notIncludedMocs.isEmpty()) { outStream << "enum some_compilers { need_more_than_nothing };\n"; } else { // run moc on the remaining headers and include them in the _automoc.cpp file end = notIncludedMocs.constEnd(); it = notIncludedMocs.constBegin(); for (; it != end; ++it) { if (generateMoc(it.key(), it.value())) { automocCppChanged = true; } outStream << "#include \"" << it.value() << "\"\n"; } } ---------------------------------------------- => the moc files are regenerated the second time automoc4 is called. I suggest to call lazyInitMocDefinitions() once and for all when the application start, even if the outputfile does not exists. Reproducible: Always
Created attachment 48090 [details] Suggested patch
Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone!
Dear Bug Submitter, This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand. Thank you for helping us make KDE software even better for everyone!
Thank you for reporting this issue in KDE software. As it was reported on an older version, can we please ask you to see if you cazn reproduce the issue with a more recent software version? If you can confirm this issue still exists in a recent version, please change the version field and the status to "REPORTED" when replying. Thank you!
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!