1..ui生成.h,.cpp文件:
(1)、用命令
uic -o hello.h hello.ui<wbr><wbr><wbr><wbr>//注意这个是生成头文件的</wbr></wbr></wbr></wbr>
uic -i hello.h -o hello.cpp hello.ui<wbr>///这时生成与hello.h相对应的hello.cpp文件</wbr>
(2)、
uic -o hello.h hello.ui
uic -o hello.cpp impl hello.h hello.ui<wbr><wbr><wbr>//<wbr>这也是 生成 与hello.h相对应的hello.cpp文件</wbr></wbr></wbr></wbr>
<wbr><p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 2.moc.exe xxx.h -o moc_xxx.cpp。</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 3.rcc.exe -name xxxxxx.qrc-oqrc_xxx.cpp</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 4.把moc_xxx.cpp添加到工程里面。</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 5.直接运行编译。</p> <p style="margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px"> 这样的好处:无需qmake -project,qmake。</p> </wbr>
Qt UI文件生成与编译流程
本文介绍如何使用uic、moc及rcc工具从Qt Designer创建的UI文件中生成对应的C++源文件,并将这些文件整合到Qt项目中进行编译,无需依赖qmake过程。
1132

被折叠的 条评论
为什么被折叠?



