Skip to content

Selected option doesn't change QPushButton icon only icon color #237

@air-bash

Description

@air-bash

Hello,

I've got:

  • Python==3.9.13
  • PySide6==6.5.0
  • QtPy==2.3.1

and I am trying to create a QPushButton which will be changing the icon on a "selected" mode/state but unfortunatelly it is not working. In other words, I am trying to create toggle QPushButton. To create the QPushButton I've taken the example from your documentation( https://qtawesome.readthedocs.io/en/latest/usage.html#examples):

# Toggle
toggle_icon = qta.icon('fa5s.home', selected='fa5s.balance-scale',
                        color_off='black',
                        color_off_active='blue',
                        color_on='orange',
                        color_on_active='yellow')
toggle_button = QtWidgets.QPushButton(toggle_icon, 'Toggle')
toggle_button.setCheckable(True)

Could I ask you for help?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions