PDA

View Full Version : Problem related to porting from QT3 to QT4 in list items



rohitjun
30th May 2007, 10:30
Hi All

I am porting my code from QT3 to QT4. I used QPtrList which allowed me to append items in my list as "void QPtrList::append ( const type * item )". Now what can i do to acheive the same result in QT4. Please help

Thanks alot

Rohit

jpn
30th May 2007, 10:33
http://doc.trolltech.com/4.2/porting4.html#qptrlist-t

rohitjun
30th May 2007, 15:45
Hi JPN

Problem is solved. Thanks alot.

But there are alot alot of modifications required to convert the code from QT3 to QT4.
Is there any simple way to do that. I am thinking of writing all the code again, because modificationa are alot. Please suggest.

Rohit

jpn
30th May 2007, 16:07
There is qt3to4 - The Qt 3 to 4 Porting Tool (http://doc.trolltech.com/4.2/qt3to4.html) which is designed to automate the most tedious part of the porting effort.

rohitjun
1st June 2007, 08:52
Hi JPN

I used the tool, it converted also. See the changed example code below

#include <qlayout.h>
#include <Q3WidgetStack>
//Added by qt3to4:
#include <Q3HBoxLayout>

but i am getting error that Q3WidgetStack and Q3HBoxLayout files not present.


Rohit

jpn
1st June 2007, 09:05
To link against the Qt3Support module, add this line to your qmake .pro file:

QT += qt3support
(adds proper include paths too).