Compile Qt UI file?
How do you compile the UI files to generate the Headers? Is there another way then having the Qt project mirror the visual studio project and compiling with Qt to get them? I guess I could have a开发者_如何学Go bat file or something that does it. What needs to be run to generate the header files from the UI?
You have to use uic
on the .ui file. This will give you the .h and the .cpp. Normally you reimplement the classes generated by this step, basically considering them abstract.
In most situations you shouldn't be dealing with uic or moc directly.
You have qmake to take care of business for you.
qmake generates a Makefile based on the information in a project file. Project files are created by the developer, and are usually simple, but more sophisticated project files can be created for complex projects. qmake contains additional features to support development with Qt, automatically including build rules for moc and uic. qmake can also generate projects for Microsoft Visual studio without requiring the developer to change the project file.
Try to create new Visual Studio project, and then choose "Qt Application" or similar - don't choose MFC application, etc... For this you have to have Qt add-in for Visual Studio. This will set it up all automatically, so you will build everything from VS.
Cheers.
精彩评论