PDA

View Full Version : Check box creating problems



mat_me
1st May 2009, 07:06
Hi,

Im using a checkBox in my application.When i check it, it is supposed to perform an action until it has been unchecked. But the problem im facing is that the action is performed only once , when i click on it (even though the check box shows checked unless i uncheck it). but my requirement is that t should work untl it as been unchecked by me.

It is of the type QCheckBox and i have connected a slot to it to perform a particular function every time a "clicked" signal is passed.
What could be the problem?Please help me.Its urgent.

Lykurg
1st May 2009, 09:20
Its urgent.
Yeah, everything is urgent the last days...
To connect use the toggled signal, then you get the information if the box is checked or not in your slot. And of course this signal is emited only once. If you want to perform a slot multiple times use a QTimer or QTimerLine which you can start or stop in your slot. Even to uncheck the box is no problem: QAbstractButton::checked.