Suppose I have the file about.ui. How can I make the "about.h" and the "about.cpp" from my .ui file? I have to create a .moc file too? How can I compile this after the creaton to see if all ocurred correctly?
Generate .h and .cpp from .ui file
27.3k views Asked by LucasCaixeta At
6
There are 6 answers
1
On
Short answer:
In QtCreator there are two ways of create a form from windows assistant: - Qt Designer Form Class - QtDesigner Form
you must create a new "Qt Designer Form Class" instead of "Qt Designer Form", because you choose "Qt Designer Form" qt creator doesn't create the .h and .cpp from .ui file:
Long Answer:
When you create "QTCreator Form" only create .ui file this is useful if you already have an existing class for the UI business logic and you want rebuilt user interface but keep business logic, you can call buttom or components with same name and interchange ui.
QMake (actually uic) will automatically generate a
ui_about.h
file that you can use to make about.cpp (just make sure to get the .pro file right). Here's a tutorialYou might want to use the lastest Qt (4.6) too btw.