Results 1 to 5 of 5

Thread: QPixmap Error with Qt5

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2011
    Posts
    2
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows Symbian S60

    Default QPixmap Error with Qt5

    I have migrated my solution from Qt4.8 to Qt5.0.1, after fixing the compilation and linking errors i got a run time error as follows

    QPixmap: Must construct a QApplication before a QPaintDevice


    error message.png

    taking in to consideration that the application was running before migrating to Qt5.0.1 and i am sure that i am constructing the QApplication in the first line in the main method as follows
    int main(argc, argv)
    {
    std::unique_ptr<QApplication> app(new QApplication(argc, argv));
    .
    .
    .
    .
    std::unique_ptr<MyMainForm> form(new MyMainForm(NULL));
    .
    .
    .

    return app.exec();
    }

    I tried to reproduce the problem in a smaller solution but it didn't appear, any suggestions will be welcomed.
    I debugged the ui_MyMainForm.h file and the code that causes the error is
    iconLabel->setPixmap(QPixmap(QString::fromUtf8(":/icons/icons/image.png")));

    working environment
    Qt5.0.1 with MSVisual studio 2010 x86
    Windows 7 x64
    Last edited by ahmed.khaled; 7th February 2013 at 20:31.

Similar Threads

  1. QPixmap error message
    By Achuthan in forum Newbie
    Replies: 3
    Last Post: 5th June 2012, 21:18
  2. Replies: 1
    Last Post: 23rd September 2010, 17:12
  3. Replies: 1
    Last Post: 21st August 2008, 07:44
  4. Replies: 5
    Last Post: 9th April 2007, 14:26
  5. QPixmap::convertFromImage error (qt 4.1.1, g++ 3.3.2, Solaris SPARC 10)
    By freak in forum Installation and Deployment
    Replies: 3
    Last Post: 30th October 2006, 21:30

Tags for this Thread

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.