I have QGroupButtons of 5 buttons, and I want that all of them will be disabled without color changing..
setDisable() is suitable, but this changing color..
Printable View
I have QGroupButtons of 5 buttons, and I want that all of them will be disabled without color changing..
setDisable() is suitable, but this changing color..
You can disconnect the clicked signal.
No, any othter idea.
what I must to do that button.setEnable(true) and button.setEnabled(false) have same view?
Why not?Well it is the idea that it is displayed differently. So this is the wrong way to go!Quote:
what I must to do that setEnable(true) and setEnabled(false) have same view?
Stick with the signals as Zlatomir said. You also can use QObject::blockSignals() which could be more easier to use.
You can take over the drawing of the button, but what you are trying to do is directly against the user interface guidelines.
Is there a reason you don't want to inform the user the button isn't clickable?
It is too hard to explain, because my English is bad.
Ok, i will try.
I have 5 buttons, after clicked on one of them sound start playing, and while sound are playing, user can select any of 5 buttons, and i don't want this (yeah, I can do BlockSignal, but I always can select any other button).
If after cliked i do "setDisabled(true) " for all 5 buttons, there is some unlikely view when all buttons are Disabled
I don't see the difference between:
1) All the buttons are disabled
2) The buttons look enabled, but are not clickable
In fact, I'd say (2) would be more confusing.
Maybe a better way would be: Whilst sound is playing, you show another modal window saying "Playing sound" or whatever. Due to the fact the window is modal, it blocks all mouse clicks to your other window with the 5 buttons in. Therefore the 5 buttons look enabled, but no one can click on them, and they get visual feedback why they can't click on them. When sound is finished, you destroy the window, therefore you can click on buttons again.
the difference between this:
when all the buttons are disabled, I can't select any button, but when all buttons are enabled, but not clickable, I can do this thing:
Attachment 4692i.e. I can checked some other button, but I don't want this
I have forgotten to say you, that my button is checkable