Results 1 to 3 of 3

Thread: QPixMap support

  1. #1
    Join Date
    Jun 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPixMap support

    Hi Guys

    I have qt4 installed on my Linux machine... and I have a simple dialog with a list item and a qlabel... The List dialog list tiff images, and then when you select the name, then I use the following code to show the image:

    Qt Code:
    1. QPixmap mypixmap(tiffname);
    2. QFile myfile(tiffname);
    3.  
    4. if (!myfile.open(QIODevice::ReadOnly | QIODevice::Text))
    5. {
    6. QMessageBox::warning( this , "FoneWorx PC2Fax", "Cannot find file "+myfile.fileName());
    7. return;
    8. }
    9.  
    10. if(!mypixmap.isNull())
    11. {
    12. lblPic->setPixmap(mypixmap);
    13. showFile = tiffname;
    14. }
    15. else
    16. {
    17. QMessageBox::information( this, "Information","Failed to load " + tiffname);
    18. }
    To copy to clipboard, switch view to plain text mode 

    And this works great....Then I go and compile it on my windows machine and this works great.....

    The problem seems to come in when running the exe on another machine, I can access the file, but allways seems to fail to load the image into the qpixmap...

    Am i just missing some codec or something on the 3rd machine, or would it seem that the windows compile machine, has something that allows it to show these images without a problem...

    Regards
    PreDeToR_
    Last edited by wysota; 26th June 2007 at 15:19. Reason: changed tags to [code]

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QPixMap support

    You have to copy the tiff image plugin from your Qt installation to the target machine to "imageformats" subdirectory of the directory where your application binary resides. The plugin is in the plugins/imageformats subdirectory of your Qt installation.

  3. #3
    Join Date
    Jun 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixMap support

    Thanks a Mill, That works like a charm!!!!

Similar Threads

  1. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  3. Compile QT4.2.2 with MySQL on Mac OS
    By asd in forum Installation and Deployment
    Replies: 7
    Last Post: 12th February 2007, 14:50
  4. QPixmap -> HICON trouble.
    By krivenok in forum Qt Programming
    Replies: 1
    Last Post: 11th August 2006, 15:51
  5. 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
  •  
Qt is a trademark of The Qt Company.