Qt5 User Interface Compiler: -i option not available

独自空忆成欢 提交于 2020-04-18 05:59:12

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/52708498/qt5-user-interface-compiler-i-option-not-available

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!