Results 1 to 3 of 3

Thread: Getting image file from QPixmap

  1. #1
    Join Date
    Sep 2009
    Posts
    60
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Getting image file from QPixmap

    I am creating a new QPixmap with the file name as the parameter for the constructor:
    Qt Code:
    1. QPixmap(":/.../.../name.png")
    To copy to clipboard, switch view to plain text mode 
    I looked at the documentation, and I couldn't find a function to get the file name as a QString. How do I do this?

  2. #2
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Getting image file from QPixmap

    Neither do I.

    I think you can't, since you can create and play with a QPixmap without file.
    I am afraid that you have to manage it yourself in an associative container, like a map.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Getting image file from QPixmap

    QPixmap doesn't store the file name of the picture that you set. You have to store it by yourself.

Similar Threads

  1. Replies: 2
    Last Post: 21st August 2009, 23:09
  2. Saving pure plot data to image file
    By Debilski in forum Qwt
    Replies: 4
    Last Post: 7th April 2009, 17:02
  3. Change QPixmap image at runtime
    By Qt Coder in forum Qt Programming
    Replies: 12
    Last Post: 30th March 2009, 12:37
  4. Replies: 2
    Last Post: 29th September 2008, 00:08
  5. Loading a custom image into a QPixmap
    By KShots in forum Qt Programming
    Replies: 12
    Last Post: 5th August 2006, 00:16

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.