Question

I use Visual studio 2012, and add plugin for QT. How to add new form to main window? When i try to add new item, compiler don't generates code, when i click to .h file it says "the document cannot be opened. it has been renamed deleted or moved".

Thanks.

Était-ce utile?

La solution

If you have the Visual Studio plugin installed and you add a new Qt form to the project, two new files are added to your project, a xxx.ui file under the Form Files folder and a ui_xxx.h under the Generated Files folder.

You will be allowed to edit the xxx.ui file by double-clicking on it and Qt Designer will open up.

The ui_xxx.h file will not initially be editable (not that you'd want to edit it anyway) because only a reference to it gets added in the project file, no physical file is created on the disk. The header file is only created when you execute your next build.

EDIT: If you don't want to do a full build, you could also just right-click on your new xxx.ui file in the Solution Explorer and select Compile from the context menu. That will run uic to generate your header code.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top