Results 1 to 7 of 7

Thread: QPixmap is null on other machines

  1. #1
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPixmap is null on other machines

    I have a pixmap in my program which works fine on my developing machine
    QPixmap pic("c:/01.jpg");
    but when I execute the program on another machine it doesn't seem to be loaded because the size method returns QSize(0,0) and when calling scaled method I get "pixmap is a null pixmap",I've tried it on couple of machines and permission issues are fine.
    what seems to be the problem?
    --
    thanks in advance
    ---
    A situtation never gets so complicated that it can't get any more complicated!

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap is null on other machines

    is 01.jpg in C drive on ALL machines???

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap is null on other machines

    JPG is not supported directly by Qt.
    You will need to copy jpg plugin dll to the new machine.
    You can find it in QT_DIR/4.x.x/plugins/imageformats

  4. The following user says thank you to aamer4yu for this useful post:

    sepehr (16th February 2009)

  5. #4
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: QPixmap is null on other machines

    Hi,

    I think the problem is not about the format of the image file, check the C drive out for 01.jpg as amulya said.

    King Regards

  6. #5
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap is null on other machines

    Quote Originally Posted by aamer4yu View Post
    JPG is not supported directly by Qt.
    You will need to copy jpg plugin dll to the new machine.
    You can find it in QT_DIR/4.x.x/plugins/imageformats
    exactly, you are right! problem solved!
    ---
    A situtation never gets so complicated that it can't get any more complicated!

  7. #6
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPixmap is null on other machines

    Dear all,

    I'm experiencing the same problem and I cannot solved it.
    I have a Qt Application that generates some .gif files and displays it on QLabel. It works fine on the DE I'm working with (MSVC Express 2008)
    I deployed the Qt Application and run it on another Windows machine. The application runs but when it opens the .gif images it return the error
    QPixmap::scaled: QPixmap is a NULL QPixmap. The path of the file is correct, I already check it.

    I also copied the qgif4.dll in the libraries needed by my application but still doesn't work.
    Am I missing something?

    Thanks in advance for any help

    Annalisa

  8. #7
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    507
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap is null on other machines

    Hi, the qgif4.dll needs to be located in the "imageformats" sub-directory, not in the directory where the other DLLs like qtgui4.dll are placed.

    Ginsengelf

Similar Threads

  1. Problem at time compilation in traslation of language
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2007, 14:18
  2. QPixmap and HBITMAP
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 16:24

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.