[Development] QToolButton: stuck highlighting

Laszlo Papp lpapp at kde.org
Sat Aug 6 17:46:56 CEST 2022


Hi,

As soon as I have this code in my QStyle subclass, the highlighting of the
QToolButton icon seems to get stuck after selecting an entry from its menu.

QPixmap Style::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap&
pixmap, const QStyleOption* opt) const
{
  if (iconMode == QIcon::Active) {
    return Colorize(pixmap, opt->palette.color(QPalette::Highlight), 0.5f);
  }
  return QProxyStyle::generatedIconPixmap(iconMode, pixmap, opt);
}

Here is what is happening: https://imgur.com/a/Q7UBxEu

The minimal reproducible example is available here:
https://github.com/lpapp/examples/blob/main/qt-toolbutton-dropdown

Thank you in advance.

Kind regards,
László
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220806/1a6530fd/attachment.htm>


More information about the Development mailing list