PDA

View Full Version : How to delete multiple character in edit box with long press of button?



qt_man
9th November 2009, 06:03
Hi all,

I am very new to QT based UI development. In one of UI, I have created an edit box control using QLineEdit and it has some user defined button. The button is responsible to delete character from edit box. This I am able to achieve using chop() method, but it delete one character at a time , even after button is pressed long enough. In case of long press of button, expected behaviour is to delete multiple character from edit control untill button is released.

One solution for this can be - create my own thread which will keep watch on button press, but I am reluctant to use thread because of resource utilization optimization. So, I would like to understand from you guys that is there any QT's way to achieve this functionality?.

Your help is most welcomed.

Regards,
mani

yogeshgokul
9th November 2009, 06:47
Hi all,

I am very new to QT based UI development. In one of UI, I have created an edit box control using QLineEdit and it has some user defined button. The button is responsible to delete character from edit box. This I am able to achieve using chop() method, but it delete one character at a time , even after button is pressed long enough. In case of long press of button, expected behaviour is to delete multiple character from edit control untill button is released.
Please give it a try.

yourButton->setAutoRepeat(true);

qt_man
10th November 2009, 06:17
Please give it a try.

yourButton->setAutoRepeat(true);

Thanx

done ! :D