[Development] QToolButton: stuck highlighting

Volker Hilsheimer volker.hilsheimer at qt.io
Tue Aug 16 19:47:24 CEST 2022


Hi Laszlo,

Popup handling on macOS has been rewritten and cleaned up quite significantly in Qt 6 to fix exactly that kind of problem.

Some relevant JIRA tickets referenced in respective commits in qtbase/src/plugins/platforms/cocoa would be QTBUG-78750, QTBUG-66513, QTBUG-69710, QTBUG-78970, QTBUG-96450, QTBUG-77833, QTBUG-30522.

There still seem to be some minor kinks left (some of which probably introduced by these changes, like QTBUG-105474). Given the scope of those changes, I don’t think there’s anything that qualifies for a backport to Qt 5.15.

Volker


> On 10 Aug 2022, at 22:19, Laszlo Papp <lpapp at kde.org> wrote:
> 
> Hi,
> 
> I am unable to reproduce the below bug on Windows and Linux.
> 
> I can reproduce this on Mac with 5.15.5, but cannot with 6.4.0 beta2.
> 
> Do you know what has fixed this? Can we backport the fix to 5.15?
> 
> Is there a workaround that I could apply locally for the time being?
> 
> Thanks.
> 
> On Sat, Aug 6, 2022 at 4:46 PM Laszlo Papp <lpapp at kde.org> wrote:
> 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ó
> 
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development



More information about the Development mailing list