Results 1 to 5 of 5

Thread: QPaintDevice: Must construct a QApplication before a QPaintDevice

  1. #1
    Join Date
    Mar 2009
    Location
    delhi India
    Posts
    56
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default QPaintDevice: Must construct a QApplication before a QPaintDevice

    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.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

    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/an...ary_compatible
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. The following user says thank you to amleto for this useful post:

    vaibhav (27th December 2011)

  4. #3
    Join Date
    Mar 2009
    Location
    delhi India
    Posts
    56
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

    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 .?

  5. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

    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.

  6. #5
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPaintDevice: Must construct a QApplication before a QPaintDevice

    Quote Originally Posted by vaibhav View Post
    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?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 16
    Last Post: 12th December 2014, 21:22
  2. Replies: 2
    Last Post: 25th July 2011, 09:08
  3. Replies: 0
    Last Post: 20th April 2009, 18:45
  4. Must construct QApplication before QPaintDevice
    By sekatsim in forum Qt Programming
    Replies: 16
    Last Post: 8th June 2008, 01:00
  5. Replies: 15
    Last Post: 21st April 2007, 18:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.