PDA

View Full Version : QPaintDevice: Must construct a QApplication before a QPaintDevice



vaibhav
26th December 2011, 07:39
Hi,

My Application uses QApplication before creating any QT widget's, but still i am getting this issue .

My application is service component based application which is build-ed using QT 4.5.3 and when i request my service to load the component it loads the component(It uses QT classes 3.3.6) which requires QT_MT336.dll which i had copied.

So in general My QT Application version is 4.5.3 and the component that it loads dynamically is builded using 3.3.6.

Is this the reason for the bug?If yes then what work-around would you suggest so that i don't need to build the component (QT 3.3.6 ) again to QT 4.5.

Can't QT 4.5 use the QT 3.3.6 code (Backward Compatibility) ? .

Any help would be appreciated .

Thanks.

amleto
26th December 2011, 15:14
Different versions are not binary compatible, so you cannot use 3.x libraries with 4.x code.

Point releases are binary compatible, so you can use 4.x libraries with 4.x code.

You need to rebuild.

http://developer.qt.nokia.com/faq/answer/is_qt_binary_compatible

vaibhav
27th December 2011, 09:24
Do you think "Must construct a QApplication before a QPaintDevice " error message is possible cause of different version's of QT libraries (4.5.3 to 3.3.6 )that are loaded .?

Lykurg
27th December 2011, 09:36
Why not? The library expects a Qt 3 QApplication while you have created a Qt 4 QApplication. Possible. Make a small test case and see.

amleto
27th December 2011, 11:34
Do you think "Must construct a QApplication before a QPaintDevice " error message is possible cause of different version's of QT libraries (4.5.3 to 3.3.6 )that are loaded .?

Please dont tell me you are going to ignore the fact the versions are not compatible and try to make things work?