qmake will create a ui_*.h file for any *.ui file listed in the PRO file FORMS variable.

The typical usage pattern for that intermediate ui_*.h file is through user-defined class as you describe. See Using a Designer UI File in Your Application for options. The header and source file for that user class should be listed in the pro file HEADERS and SOURCES variable respectively. You only need do this once, and you certainly should not be running "qmake -project", which creates a basic starter PRO file, routinely. Any time you modify the PRO file you need to re-run "qmake" once (not twice) and typically with no arguments other than a path to the PRO file if it is not in the current directory. Modifying the referenced UI, source, or header files does not generally require rerunning qmake unless you add or remove Q_OBJECT macros.

I don't use the VC plugin but I would assume that most of this is done for you. Perhaps someone who does use it could shed light.


For a pop-up dialog style of thing you would put the code for handling the dialog UI, e.g. interaction between widgets within the dialog etc., in the dialog class along with any access methods you need for outside users. The main window then only need to create an instance of the dialog class and exec() or show() it. Code to access the values in the dialog and do something with them has to exist somewhere, and the "correct" location is application dependent.