0

I created a .ui file (myform.ui) using QtDesigner and I would like to create the corresponding header (myform.h) and implementation (myform.cpp) file.

Now I can create the header file (myform.h) with the following command on Linux:

uic mainwindow.ui -o mainwindow.h

An older answer on StackExchange (here) suggested using the following command to create the implementation file (myform.cpp):

uic -i mainwindow.h -o mainwindow.cpp mainwindow.ui

However, the command option -i doesn't seem to be supported by uic, I get the error message "unknown option -i".

Does anyone know how I can automatically generate the .cpp file from the .h and .ui file?

uic Version is 5.9.5

Mantabit
  • 269
  • 1
  • 4
  • 14

1 Answers1

1

Only header files need to be generated, all the code (which is setupUi() and retranslateUi()) is inside the header generated by uic.

Jens
  • 6,173
  • 2
  • 24
  • 43