Nominate our 2022 Qt Champions!

Why does adding custom build step in Visual Studio Qt project with Qt add-in stop automatic MOC and UIC steps?

  • Also posted "here": but has attracted no response after 5 days.

    I have a Visual Studio Qt project using the Visual Studio Qt Add-in. The Add-in automatically creates a Custom Build Tool rule for .ui files and for each header file that has classes with the Q_OBJECT declaration to run the UIC and MOC respectively.

    This all works perfectly until I add a Custom Build Tool rule for the project as a whole. In this instance, the rule is specific to the Release build and invokes code signing and is set to Execute after: Build. With this configuration, the Debug build works correctly, but the Release does not automatically execute the MOC or UIC. I can right click the Q_OBJECT headers and .ui files in the project browser and manually force a Compile for all necessary files, and they are correctly MOC'd and UIC'd and can then build, but a rebuild or build after clean always fails.

    Why has adding a project Custom build rule for the project appear to have suppressed the Custom Build Tool rules associated .ui and Q_OBJECT headers?

Log in to reply