PDA

View Full Version : How to disable pushbutton after clicking it



Cengaver
19th April 2011, 14:10
I created lots of pushbutton in a buttongroup and add slot and signal to them with` QT DESIGNER`. What I want to do is; after clicking any of the pushbuttons some operation will be done and after all finished the pushbutton should be disabled. How can I disable it(All I know is I can do it with isEnabled and setEnabled and we do not know which button is clicked)

high_flyer
19th April 2011, 14:15
and we do not know which button is clicked
QObject::sender()

FelixB
19th April 2011, 14:15
in a slot, you can use the "sender()"-method to obtain the object which emitted the signal.

edit: *arg* less text and I would have been faster than high_flyer;)

squidge
19th April 2011, 14:22
Or even high_flyer, which is who replied before you, not wysota :D

FelixB
19th April 2011, 14:32
oh yes, I always mix them up because of the "certified developer"-logo :o

high_flyer
19th April 2011, 14:38
I think wysota will mind more to be mixed up with me, then I am with him :)

Cengaver
19th April 2011, 14:43
in a slot, you can use the "sender()"-method to obtain the object which emitted the signal.

I do not know how to use :D

FelixB
19th April 2011, 14:55
then read the link high_flyer posted. or show us what you tried so far...

BalaQT
19th April 2011, 15:29
hi,

I do not know how to use
use qobject_cast to cast the sender();

Bala

wysota
19th April 2011, 16:02
I think wysota will mind more to be mixed up with me, then I am with him :)

Naaa... all stays in the family :) Besides, I'd like to participate in a lets-go-to-mars project too, so I don't mind :cool:

high_flyer
19th April 2011, 16:06
I'd like to participate in a lets-go-to-mars project too, so I don't mind
really??
I am sure we can find something for you to chew on! ;)

wysota
19th April 2011, 16:14
I am sure we can find something for you to chew on! ;)
If it involves coding Qt and not speaking German then bring it on! :)

high_flyer
19th April 2011, 16:22
We do all our non embedded coding in Qt.
Project language is English.
Once we get RTEMS running on our hardware depending on time and how much sense it will make we might try to port Qt to RTEMS.
At the moment there is not much to do that I can't do on my own in a relaxed time span.
But as we get nearer to launch (end 2013) we will need quite a bit of work done for the ground station -> Qt Desktop - and then help will be much appreciated.
I'll contact you then again.