PDA

View Full Version : Reg - Conversion of Qt3 to Qt4



suresh
28th August 2006, 18:13
dear all,

Now i am trying to convert the Qt3.3.4 files into Qt4.1.4. After Executing Qt3to4 in cmd mode it gives the following some errors.

D:/Qt/4.1.4/include/QtCore\../../src/corelib/thread/qthread.h(31) : error C2146: syntax error : missing ';' before identifier 'QT_MODULE'
D:/Qt/4.1.4/include/QtCore\../../src/corelib/thread/qthread.h(31) : error C2501: 'QT_BEGIN_HEADER' : missing storage-class or type specifiers
D:/Qt/4.1.4/include/QtCore\../../src/corelib/thread/qthread.h(31) : fatal error C1004: unexpected end of file found
zonetrader.cpp
C:\Qt\3.3.4\include\qhostaddress.h(59) : error C2079: 'QHostAddress' uses undefined class 'Q_EXPORT'
C:\Qt\3.3.4\include\qhostaddress.h(59) : error C2239: unexpected token '{' following declaration of 'QHostAddress'
C:\Qt\3.3.4\include\qsocket.h(58) : error C2079: 'QSocket' uses undefined class 'Q_EXPORT'
C:\Qt\3.3.4\include\qsocket.h(58) : error C2239: unexpected token ':' following declaration of 'QSocket'
C:\Qt\3.3.4\include\qsocket.h(58) : error C2059: syntax error : 'public'
C:\Qt\3.3.4\include\qptrcollection.h(50) : error C2079: 'QPtrCollection' uses undefined class 'Q_EXPORT'
C:\Qt\3.3.4\include\qptrcollection.h(50) : error C2239: unexpected token '{' following declaration of 'QPtrCollection'
C:\Qt\3.3.4\include\qgdict.h(53) : error C2653: 'QPtrCollection' : is not a class or namespace name
C:\Qt\3.3.4\include\qgdict.h(53) : error C2146: syntax error : missing ';' before identifier 'getData'
C:\Qt\3.3.4\include\qgdict.h(53) : error C2501: 'Item' : missing storage-class or type specifiers
C:\Qt\3.3.4\include\qgdict.h(53) : warning C4183: 'getData': member function definition looks like a ctor, but name does not match enclosing class
C:\Qt\3.3.4\include\qgdict.h(54) : error C2653: 'QPtrCollection' : is not a class or namespace name
C:\Qt\3.3.4\include\qgdict.h(54) : error C2146: syntax error : missing ';' before identifier 'setData'
C:\Qt\3.3.4\include\qgdict.h(54) : error C2501: 'Item' : missing storage-class or type specifiers
C:\Qt\3.3.4\include\qgdict.h(54) : error C2653: 'QPtrCollection' : is not a class or namespace name


All errors shows in qt include files. give any solutions.

regards,
suresh.

jacek
28th August 2006, 19:59
Why does it include both Qt3 and Qt4 headers?

suresh
28th August 2006, 21:06
I set only Qt4 includes in environment variables.

jacek
28th August 2006, 21:11
Check your project --- maybe path to Qt3 is set somewhere. Make sure you use Qt4 tools and double check your enviroment variables (echo %PATH% and so on).

suresh
28th August 2006, 21:24
I crosschecked the environment variables and vc++ settings. i couldn't find the Qt3 include. Is there any possibility in somewhere because previously i was working with Qt3

Regards,
suresh.

jacek
28th August 2006, 21:28
Did you run "make clean"? Which file do you get those errors for?

suresh
28th August 2006, 21:41
After running "make clean" the following errors occured.

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.

nmake -f Makefile.Debug clean

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.

del moc\moc_zonetraderwidget.cpp
Could Not Find D:\projects\inprogress\Avadhi_orderSim\OrderSimula tion_Augest\Plu
gins\ZoneTrader\moc\moc_zonetraderwidget.cpp
del qmake_image_collection.cpp
Could Not Find D:\projects\inprogress\Avadhi_orderSim\OrderSimula tion_Augest\Plu
gins\ZoneTrader\qmake_image_collection.cpp
del obj\zonetraderwidget.obj
Could Not Find D:\projects\inprogress\Avadhi_orderSim\OrderSimula tion_Augest\Plu
gins\ZoneTrader\obj\zonetraderwidget.obj
del obj\plugin.obj
Could Not Find D:\projects\inprogress\Avadhi_orderSim\OrderSimula tion_Augest\Plu
gins\ZoneTrader\obj\plugin.obj
del obj\moc_zonetraderwidget.obj
Could Not Find D:\projects\inprogress\Avadhi_orderSim\OrderSimula tion_Augest\Plu
gins\ZoneTrader\obj\moc_zonetraderwidget.obj
del ..\..\bin\plugins\designer\ZoneTrader.exp


Regards,
suresh.

jacek
28th August 2006, 21:55
After running "make clean" the following errors occured.
I don't see any errors.


del qmake_image_collection.cpp
If your Makefile knows something about image collections, then it isn't a Qt4 Makefile --- generate a new one and try again.

Brandybuck
28th August 2006, 22:51
If your Makefile knows something about image collections, then it isn't a Qt4 Makefile --- generate a new one and try again.
Not true. uic3 will create a qmake_image_collection.cpp from an IMAGES variable in the .pro file.

Like Qt3Support, this is a porting aid. You want to use resources instead of IMAGES in your finished project, but since you can't do everything at once, it's a helpful tool to get you there.

suresh
28th August 2006, 23:06
Atlast I found my error. In vc++ Directories Qt3 path set. I changed and now it works fine.

Thanks to Jacek and Brandybuck.

Regards,
suresh.

jacek
28th August 2006, 23:10
uic3 will create a qmake_image_collection.cpp from an IMAGES variable in the .pro file.
Probably you are right, but I don't remember that IMAGES did work when I was porting my apps to Qt4. It was some time ago, so either I don't remember well, or something has changed.

Anyway there is no IMAGES variable in Qt4 docs (there's FORMS3 only).