For QPushButton I set an icon with 3 installed images: Normal , Disabled , Active . After building and running on linux, everything works as expected - when you hover the mouse cursor, the picture changes from Normal to Active . But in Windows - does not change.

Looks like some kind of bug. Maybe someone knows a workaround?

The button creation code is as follows:

QIcon ic(":/4Mouse/icons/MousePictures/OnCell.png"); ic.addPixmap( QPixmap(":/4Mouse/icons/MousePictures/OnPict.png"), QIcon::Active); ic.addPixmap( QPixmap(":/4Mouse/icons/MousePictures/OnCellGray.png"),QIcon::Disabled); QPushButton* info = new QPushButton(ic, "", this); const QSize sz = ic.availableSizes()[0]; info->setIconSize(sz); info->setFocusPolicy(Qt::NoFocus); info->setFlat(true); info->setGeometry(x, 1, sz.width(), sz.height()); info->setCursor(QCursor(Qt::PointingHandCursor)); 

P.S. Now Qt5.6.3 on Windows - the last supporting XP.

  • Attach the code handler change your icons. - aleks.andr
  • No handler wrote - in linux everything is highlighted by itself. - tonal
  • then how you install - free_ze
  • The addPixmap(const QPixmap &pixmap, Mode mode = Normal, State state = Off) method addPixmap(const QPixmap &pixmap, Mode mode = Normal, State state = Off) has the third parameter State . Maybe it's the case? Here is an example . - aleks.andr
  • In the text, generated for the form where I use the same buttons, all 6 options are set explicitly. those. for QIcon :: Off and for QIcon :: On. The behavior is exactly the same. - tonal

0