'Something in Visual Studio is constantly changing my c++ header Item Type assignments...how to track down the source?

I have a MSVS 2019 C++ project which includes Qt source files that are processed by the Qt moc. In order for my header files (and thus, class declarations) to be processed by the moc, I right click them and set the 'Item Type' to 'Qt Meta-Object Compiler (moc)'. All is well, the moc runs on the assigned files and the project compiles.

But sometimes the 'Item Type' for those files will be reverted to 'C/C++ header' and the project no longer compiles. After this spooky mystery process messes up my assignments, I have to manually set the 'Item Type' back to moc before the project will compile again.

My question is: what the hell is touching my settings and how do I disable it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source