2011-12-20 142 views
1

我在Google上搜索了很长时间,并且发现了很多关于使用uic3将Qt3.3 XML转换为Qt4进行编译的信息,但是没有关于如何更改或查找使用Qt4(4.0)生成的.ui文件。无法编译。以下是我尝试在每个.ui文件上运行uic的输出示例(我正在编译防火墙生成器的最新版本,供参考)正如您所看到的,其中一些文件失败,另一个文件失败,'asklibforcopydialog_q.ui'成功如何使用Qt uic 4.2.1编译Qt Designer 4.0 XML文件?

[[email protected] libgui]$ ls *.ui | xargs -n1 uic |more 
uic: File generated with too old version of Qt Designer 
File 'aboutdialog_q.ui' is not valid 
uic: File generated with too old version of Qt Designer 
File 'actionsdialog_q.ui' is not valid 
uic: File generated with too old version of Qt Designer 
File 'addressrangedialog_q.ui' is not valid 
uic: File generated with too old version of Qt Designer 
File 'addresstabledialog_q.ui' is not valid 
/******************************************************************************** 
** Form generated from reading ui file 'asklibforcopydialog_q.ui' 
** 
** Created: Tue Dec 20 10:03:26 2011 
**  by: Qt User Interface Compiler version 4.2.1 
** 
** WARNING! All changes made in this file will be lost when recompiling ui file! 
********************************************************************************/ 
(many more lines snipped) 

所以。我是否需要尝试查找旧版本的uic还是有一个相对直接的(正则表达式,sed/awk)更改,我可以使XML以允许它与此版本进行编译?我无法想象在同一个主要版本中编译器不能向后兼容,但我们在这里。初步检查像上面那样编译的XML文件,以及抛出uic: File generated with too old version of Qt Designer错误的XML文件在XML中没有显示出明显的区别,但是我不是。

帮助我堆栈溢出,你是我唯一的希望!

+0

您可以尝试在Qt Designer中打开ui文件并保存它们。 – hmuelner 2011-12-20 16:33:55

回答

2

您寻求的答案是:uic3 -convert