Results 1 to 2 of 2

Thread: setIcon() - different QIcon states?

  1. #1
    Join Date
    Sep 2007
    Posts
    14
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default setIcon() - different QIcon states?

    How do I actually access the different states of a QIcon, and use them in the setIcon() functions of various Qt objects?

    Supposedly, the QIcon class automatically generates different versions, such as a grayscale version for a disabled state. It seems the only way to access them is to generate a specific W x H pixmap of it, or to change the state of an entire Data Model item.

    Is there something that might be the equivalent of setIcon(const QIcon &icon, QIcon::Mode mode) for many Qt objects?

    Thanks!

  2. #2
    Join Date
    Jan 2008
    Location
    Silicon valley
    Posts
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setIcon() - different QIcon states?

    Quote Originally Posted by AaronMK View Post
    How do I actually access the different states of a QIcon, and use them in the setIcon() functions of various Qt objects?
    Supposedly, the QIcon class automatically generates different versions, such as a grayscale version for a disabled state. It seems the only way to access them is to generate a specific W x H pixmap of it, or to change the state of an entire Data Model item.
    If you need to access the image of generated QIcon, you could use QIcon::pixmap with needed Mode to access any state. Then you could construct a new QIcon from it, and use it.

Similar Threads

  1. Make error with Qt Jambi 4.3.2_01
    By pamalite in forum Installation and Deployment
    Replies: 0
    Last Post: 22nd November 2007, 12: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.