Results 1 to 4 of 4

Thread: QPixmap::convertFromImage error (qt 4.1.1, g++ 3.3.2, Solaris SPARC 10)

  1. #1
    Join Date
    Feb 2006
    Posts
    25
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPixmap::convertFromImage error (qt 4.1.1, g++ 3.3.2, Solaris SPARC 10)

    I'm having the following problem. I build an application on solaris 10 machine add a few images to the GUI and it works fine on the machine I build it on.

    When I move my application to a different solaris 10 machine it runs but no images are displayed and I get the following error:

    Qt Code:
    1. QPixmap::convertFromImage: Cannot convert a null image
    To copy to clipboard, switch view to plain text mode 

    The sample code of one of the images is the following :

    Qt Code:
    1. QImage logo(":/images/logo.jpg");
    2.  
    3. QLabel *imageLabel = new QLabel;
    4.  
    5. imageLabel->setBackgroundRole(QPalette::Base);
    6. imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    7. imageLabel->setScaledContents(false);
    8. imageLabel->setPixmap(QPixmap::fromImage(logo));
    9. imageLabel->resize(190,78);
    To copy to clipboard, switch view to plain text mode 

    Any help is appreciated. Thanks in advanced.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap::convertFromImage error (qt 4.1.1, g++ 3.3.2, Solaris SPARC 10)

    Did you copy JPEG plugin to that other machine?

  3. #3
    Join Date
    Feb 2006
    Posts
    25
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap::convertFromImage error (qt 4.1.1, g++ 3.3.2, Solaris SPARC 10)

    Greetings,

    I'm actually trying to deploy the built application to another Solaris machine rather than try to build it there since I do not have a development environment on that one. Do I still have to add a plugin? if so, how is this done?

    I guess my question is, how do you deploy an app that has images (jpg format) embedded in it using the resources method?

    Thanks in advanced.

    Freak
    Last edited by freak; 30th October 2006 at 18:38.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap::convertFromImage error (qt 4.1.1, g++ 3.3.2, Solaris SPARC 10)

    Quote Originally Posted by freak View Post
    Do I still have to add a plugin? if so, how is this done?
    The code that handles JPEG format is in the plugin, if it won't be available, you won't have JPEG support.

    You can create "imageformats" subdirectory in the directory where your executable is and place the plugin there, but there are other possibilities (described here). Also you might try to compile the plugin into your application as a static plugin, but I'm not sure if it will work with non-static Qt.

Similar Threads

  1. QT 4.1.1 on Solaris 10
    By KaptainKarl in forum Installation and Deployment
    Replies: 1
    Last Post: 7th February 2007, 13:51

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.