Results 1 to 6 of 6

Thread: Long press event

  1. #1
    Join Date
    Jul 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Long press event

    hi all,

    I jus want to know if there is a long press event available in Qt
    The module im working on currently requires long press. I have seen long press in C7 for uninstalling

    The click event and the press event gives the same result right?

    alfah

  2. #2
    Join Date
    Sep 2008
    Location
    Poland
    Posts
    80
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Long press event

    Check QAbstractButton::autoRepeat

  3. #3
    Join Date
    Jul 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: Long press event

    I checked that out, could you give me some ideas as to how to go about it.

    alfah

  4. #4
    Join Date
    Sep 2008
    Location
    Poland
    Posts
    80
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Long press event

    If you provide more exact details about what you wish to archieve,then maybe I'll be able to help you

  5. #5
    Join Date
    Jul 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: Long press event

    Sorry about not being clear. Yes, Im talking about key presses. I want to know to if there is a way to implement long key press. Ie if i click the button once it does an activity, if i press it twice it does another activity. These i have already done. Now I want to press and hold for some time to start yet another activity.

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Long press event

    You can use a QTimer and use the 'press' and 'release' signals of the button to start and stop the timer. Once the timer reaches your time you can do whatever.

Similar Threads

  1. Key Press Event and Shift key problem
    By Teefs in forum Qt Programming
    Replies: 7
    Last Post: 18th April 2011, 10:39
  2. Key Press Event Handling
    By kosasker in forum Newbie
    Replies: 8
    Last Post: 22nd March 2011, 16:49
  3. Paint event function in key press event
    By soumya in forum Qt Programming
    Replies: 6
    Last Post: 2nd February 2010, 13:40
  4. Replies: 2
    Last Post: 10th November 2009, 07:17
  5. Key Press Event trouble
    By morraine in forum Newbie
    Replies: 6
    Last Post: 18th August 2008, 09:43

Tags for this Thread

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.