Results 1 to 2 of 2

Thread: How to get the QIcon fileneme in use.

  1. #1
    Join Date
    Jan 2009
    Posts
    78
    Thanks
    21
    Thanked 1 Time in 1 Post

    Default How to get the QIcon fileneme in use.

    Hello

    I have buttons that i want to change the icon image file depending on some situations.
    I use:
    Qt Code:
    1. ui->objectname->setPixmap(QPixmap(":/prefix/alias"));
    To copy to clipboard, switch view to plain text mode 
    Is the a way to read the resource name into a QString (for instance)?

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to get the QIcon fileneme in use.

    No. Once an image has been loaded, there is no reference to any file at all. Loading images from files is provided for convenience. Images can be loaded directly from an array of bytes too, without files involved.
    J-P Nurmi

Similar Threads

  1. QIcon and System Icons
    By tntcoda in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2009, 00:21
  2. Storing/retrieving a QIcon from a database
    By KShots in forum Qt Programming
    Replies: 5
    Last Post: 1st June 2008, 03:55
  3. setIcon() - different QIcon states?
    By AaronMK in forum Qt Programming
    Replies: 1
    Last Post: 29th January 2008, 04:10
  4. Make error with Qt Jambi 4.3.2_01
    By pamalite in forum Installation and Deployment
    Replies: 0
    Last Post: 22nd November 2007, 13:05

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.