Adding Form Files to the Project

The Visual Studio Add-in lets you launch Qt Designer simply by double-clicking on a .ui file. See the Qt Designer manual} for more information.

To add a new .ui file to the project, select Project|Add New Item and then select the Qt Widget Form or the Qt Dialog Form template from the Qt Project Items folder.

Normally, you will need to wrap the code generated for the form file into a QWidget subclass to add signals or slots to it. A convenient way to do this is to select Project|Add Class and then select Qt4GuiClass from the Qt4Classes folder. This will create a .ui file, a .h file, and a .cpp file for you.

Creating Form Templates

You can add customized form templates by following these steps:

  • Create a form in the Qt Designer and save the .ui file (e.g. mydialog.ui).
  • Copy mydialog.ui to the uiItems\ directory within the Qt Visual Studio Add-in installation directory.
  • Create an icon file named mydialog.ico. It should have a size of 32x32 pixels.

After the next start of Visual Studio you can add new forms using your custom template.

[Previous: Managing Projects] [Next: Managing Resources]

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

')[0]; s.parentNode.insertBefore(ga, s); })();