How do I change button's icon in function? I can set the icon in constructor by calling btn->setIcon(QIcon("ico1.png")) but if I try to change icon in function (btn->setIcon(QIcon("ico2.png"))) the program crashes. I don't want to change the icon on toggle.
Bookmarks