Compile Qt UI file?

How do you compile user interface files for creating headers? Is there any other way when a Qt project mirrors a visual studio project and compiles with Qt to get them? I guess I might have a bat file or something. What do you need to run to create header files from the user interface?

+4
source share
3 answers

You must use uic in the .ui file. This will give you .h and .cpp. You usually redefine the classes generated by this step, basically looking at them abstractly.

+6
source

In most situations, you should not deal with uic or moc directly.
You have qmake to take care of the business for you.

qmake generates a makefile based on the information in the project file. Project files are created by the developer, and typically simple but more complex 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 create projects for Microsoft Visual Studio, which does not require a developer to modify the project file.

+3
source

Try creating a new Visual Studio project, and then select "Qt Application" or similar - do not select an MFC application, etc. To do this, you must have a Qt add-in for Visual Studio. This will automatically install it, so you will build everything from VS.

Greetings.

0
source

All Articles