Results 1 to 1 of 1

Thread: QIcon Active-/Normal Mode have no diffrent effect

  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default QIcon Active-/Normal Mode have no diffrent effect

    I packed only one png picture into the QIcon and changed its mode.

    the effect of the mode normal and active is visually the same. But with mode disabled, it is clearly differently rendered.

    any problem could be?

    Qt Code:
    1. QIcon icon;
    2. icon.addPixmap(QPixmap(dirPath + tr("options.png")));
    3. icon.addPixmap(QPixmap(dirPath + tr("options.png")));
    4.  
    5. QLabel* label = new QLabel(this);
    6. label->setPixmap(icon.pixmap(128, 24, QIcon::Active));
    To copy to clipboard, switch view to plain text mode 

    Solved:

    I should read the manual carefully:

    When QIcon is provided with only one available pixmap, that pixmap is used for all the states and modes. In this case the pixmap's icon mode is set to normal, and the generated pixmaps for the normal and active modes will look the same. But in disabled and selected mode, Qt will generate a slightly different pixmap.
    Last edited by cic; 4th September 2013 at 09:59.

Similar Threads

  1. Replies: 1
    Last Post: 7th March 2012, 21:34
  2. QFtp bug ?? When in active mode
    By fredcrs in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2010, 14:34
  3. Replies: 1
    Last Post: 11th November 2009, 12:22
  4. Replies: 1
    Last Post: 2nd November 2009, 12:02
  5. Replies: 2
    Last Post: 31st May 2006, 21:52

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.