Results 1 to 3 of 3

Thread: How to delete multiple character in edit box with long press of button?

  1. #1
    Join Date
    Nov 2009
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to delete multiple character in edit box with long press of button?

    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

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to delete multiple character in edit box with long press of button?

    Quote Originally Posted by qt_man View Post
    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.
    Qt Code:
    1. yourButton->setAutoRepeat(true);
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to yogeshgokul for this useful post:

    qt_man (10th November 2009)

  4. #3
    Join Date
    Nov 2009
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Thumbs up Re: How to delete multiple character in edit box with long press of button?

    Quote Originally Posted by yogeshgokul View Post
    Please give it a try.
    Qt Code:
    1. yourButton->setAutoRepeat(true);
    To copy to clipboard, switch view to plain text mode 
    Thanx

    done !

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.