Details
-
Bug
-
Resolution: Cannot Reproduce
-
P3: Somewhat important
-
None
-
2.4.2
-
None
-
Visual Studio 2017
Description
When defining a QObject class / using the Q_OBJECT macro in a cpp file, the VS plugin properly registers the file as QtMoc item.
This causes the file to be moc'ed during build, but also takes the original cpp file out of normal compilation.
In this case, the generated cpp file fails to compile, because it is missing the class definitions from within the original cpp file.
The usual workaround for this is to include the generated cpp file at the end of the original source file, but this does not work anymore: By default, the original cpp file isn't compiled at all anymore.
The "Dynamic C++ Source" property seems to be the way to change this behavior, but switching it from the default "Output File" to "Input File" just disables compilation of the generated file (expected behavior for "Disable"). The original source file is still NOT compiled at all.
(See attached example project, "MocCPP.cpp" is not compiled at all)