uic: Unexpected element name

2.1k views Asked by At

I am trying to compile a .pro file using qmake and Qt4 to get a library from qttestrunnerlib.pro but I get this error:

~/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

When I use Qt3 it works, and I get my lib successfully. But I want to upgrade it to Qt4. Is it possible? and what should I do?

2

There are 2 answers

6
ScarCode On

That is because the designer in qt4 is different from qt3. means ui files generated by qt3 and qt4 are not the same. 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. 
0
Ciprian Ciubotariu On

I've used uic3 from the qt3-support package (on gentoo at least)

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