I solved it using stylesheet. When I disable button I repeat this command: button->setStyleSheet("background-image: url(path_to_image);");
I solved it using stylesheet. When I disable button I repeat this command: button->setStyleSheet("background-image: url(path_to_image);");
Aside from the mechanics of how you get this to work, why would you want to show a button as enabled when it isn't? There's a reason why there are various states for UI controls (enabled, disabled, selected, etc.) - it is to give users a visual clue about what they can (or can't) do at a given point, or what will happen by default (the selected button will be "clicked" if you press Enter on a dialog).
Why would you want to implement a GUI that is deliberately confusing to users? I can see someone repeatedly clicking on this button, and getting angrier each time because nothing happens.
Because I'm using my own icon to show that button is disabled. I only need to put big X on top of my button and that will indicate it is disabled (I'm making a game)
d_stranz (19th February 2013)
OK, that makes sense. As long as you show the user somehow that "You can't press this button now", then that is consistent with what the user expects.
Bookmarks