Results 1 to 3 of 3

Thread: QPixmap::save() doesn't work

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

    Default QPixmap::save() doesn't work

    Hi,

    I'm trying to save a QPixmap using the following code:
    Qt Code:
    1. void MainWindow::fileExport()
    2. {
    3. QString file = QFileDialog::getSaveFileName(this, tr("Export as"), tr("."), tr("Images (*.jpg);;Images (*.tiff)"));
    4. QMessageBox::information(this, "Export", file);
    5. displayPixmap.save(file,0,100);
    6. QMessageBox::information(this, "Finished", "Finished exporting");
    7. }
    To copy to clipboard, switch view to plain text mode 

    (the QMessageBox::information are just for debugging )

    On my own computer (Vista) it works, in debug and in release mode. But when I try it on a computer of a friend of mine (also Vista), it doens't. It does display the file dialog, the message box with the filename and the finished message box, however it doesn't save the file.

    Does anybody have an idea how to fix this?

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap::save() doesn't work

    probably your application can't handle with jpegs and tiffs because of lacking image formats plugins. Try to copy imageformats directory from QT_DIR\plugins into directory where your friend has your exe file. With Dependency Walker you can check if those plugins (in your case qtiff4.dll and qjpeg4.dll) require any other dlls or something.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

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

    Persoontje (25th November 2009)

  4. #3
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap::save() doesn't work

    Thanks, that did the trick. It's working now

Similar Threads

  1. Making MySQL plugin work on a windows x86 enviroment
    By Baasie in forum Installation and Deployment
    Replies: 1
    Last Post: 2nd September 2009, 15:15
  2. getting MySQL to work with Qt
    By Ashish in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2009, 08:57
  3. Qt4 : QPainter::setRedirected doesn't work
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2008, 17:52
  4. QActions don't work with menubar hidden
    By Pepe in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2007, 01:04
  5. Change work area OS
    By pakulo in forum Qt Programming
    Replies: 15
    Last Post: 15th May 2007, 07:20

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.