0

我正在尝试使用Qt4编译.pro文件以从中获取库,但出现此错误:qmakeqttestrunnerlib.pro

~/docs/UT_Cpp_Test/main/cppDir/src/qttestrunner$ qmake qttestrunnerlib.pro 
uic: Error in line 6, column 14 : Unexpected element name
uic: Error in line 6, column 14 : Unexpected element name

当我使用 Qt3 时,它可以工作,并且我成功获得了我的库。但我想将它升级到 Qt4。可能吗?我该怎么办?

4

2 回答 2

2

uic3qt3-support包中使用过(至少在 gentoo 上)

uic3 -convert ui-file-qt3.ui -o ui-file-qt4.ui

于 2012-09-28T17:05:52.313 回答
1

那是因为 qt4 中的设计器与 qt3 不同。表示qt3和qt4生成的ui文件不一样。That's why the unexpected element name error!

The uic reads a user interface definition (.ui) file in XML as generated by Qt
Designer and creates corresponding C++ header or source files.

Easiest way to solve is, use your qt4 ide to open you form and it will ask for 
conversion.Then use the newly created ui for your compilation. 
于 2012-05-25T08:49:09.413 回答