Checkable QToolButton only seems pressed on hover



  • This may be pretty basic so apologies first!

    I created a QToolButton and made it checkable. I assigned an icon to it. I expected to get it to look "pressed" when I check it. However it only looks pressed (checked) when I hover the mouse on top of it.

    Here is the code.

    @/* Skip the member definition and setting it to the layout where it is displayed */@
    @btnPause = new QToolButton;@
    @QIcon pauseIcon;@
    @pauseIcon.addFile(QString::fromUtf8(":/Pause.png"), QSize(), QIcon::Normal, QIcon::On);@
    @btnPause->setCheckable(true);@
    @btnPause->setIcon(pauseIcon);@

    Am I missing something?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.