PDA

View Full Version : QPushButton question...



JonathanForQT4
26th April 2007, 14:33
I have a bunch of qpushbuttons...when the user has clicked one, I want to set it down using setDown(true) ....which I do....the problem is: until the user has clicked another qpushbutton, the last qpushbutton should be shown as down.
This is not the case because as soon as I move the scroll bars with the mouse wheel or click somewhere on the qgraphicsscene which I have, the qpushbutton pops up. It seems to be when the mouse leaves the widget....and is used with any buttons.

anyone have some ideas?


Thanks,
Jonathan

edit://want to try something with QButtonGroup....just saw this class now...

marcel
26th April 2007, 14:46
Use a QButtonGroup with setExclusive( true ) and QToolButtons.
I never tried it with QPushButton, but it might work if you set the QPushButtons setToggleButton( true ) and then use toggle when you want a button to remain pressed.

Regards

jpn
26th April 2007, 14:47
Maybe an exclusive QButtonGroup of checkable QPushButtons would do it for you?

JonathanForQT4
26th April 2007, 14:50
ahhh, I hate when this happens (me finding something just as I post) .... if only this were the case with the GraphicsScene problems....thanks in any case guys!

edit://thanking you both cause I'm a nice guy :D