Results 1 to 8 of 8

Thread: checkable QAction shortcut hold

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: checkable QAction shortcut hold

    i started setting flags in keyPressed and keyReleased events... only to realize that when a key is being held down, pressed and released events are sent.... even though you have never released the key!! How misleading... You can never be sure, if a key release event happened when a key is actually released, or when a key stayed down for too long...

    i'm confused... maybe a code example can clear things out...
    Last edited by winder; 18th February 2010 at 02:05.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: checkable QAction shortcut hold

    What happens if you set your action autorepeat as false ?
    QAction::setAutoRepeat(false)

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: checkable QAction shortcut hold

    Quote Originally Posted by aamer4yu View Post
    QAction::setAutoRepeat(false)
    D'oh! nice...

  4. #4
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: checkable QAction shortcut hold

    Thatnks!! That's what i was looking for!

    Great! thank you.

  5. #5
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: checkable QAction shortcut hold

    I have a related question, so i post it here, rather than posting a new thread.

    i have a 3d viewport, and i want the user to be able to navigate around the scene when mouse is moved while ALT key is pressed. So what i want to do, is check inside a mouseMove event, if alt key is pressed. The thing is, i don't know how to do that!

    I also think that, maybe this way, auto repeat will still be a problem, since i'm not dealing with a particular action, to just call the setAutoRepeat(false).

    Thanks again.

  6. #6
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: checkable QAction shortcut hold

    For the auto repeat issue inside a key event handler, i think this is the solution.... bool QKeyEvent::isAutoRepeat () const

    Now how can i use alt in conjunction with mouse?

Similar Threads

  1. Checkable QLineEdit ?
    By olidem in forum Qt Programming
    Replies: 1
    Last Post: 9th December 2009, 16:47
  2. QAction shortcut
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 3rd December 2009, 20:35
  3. QTextEdit does not hold Object Id behind
    By validator in forum Qt Programming
    Replies: 3
    Last Post: 19th April 2008, 00:25
  4. checkable item
    By gyre in forum Newbie
    Replies: 1
    Last Post: 23rd November 2007, 07:44
  5. QListWidgetItem checkable
    By mikro in forum Newbie
    Replies: 1
    Last Post: 16th July 2006, 14:22

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
  •  
Qt is a trademark of The Qt Company.