Results 1 to 4 of 4

Thread: Keyboard shortcut event not received

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Keyboard shortcut event not received

    Look that the menu is in no way tied to the graphics view so pressing keys when the view has focus will not lead towards the appropriate actions. In your situation it is best to build the context menu differently. Instead of creating a custom QMenu object and adding actions to it, use the Qt::ActionsContextMenu context menu policy and use addAction() to add the actions directly to the view widget. Then all the shortcuts will be active the whole time the widget has focus and in addition if you right click the view, a context menu made of actions you added to the widget will be created for you. If you don't really want the context menu, just the shortcuts then don't set the context menu policy to ActionsContextMenu and only add the actions to the widget.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. The following user says thank you to wysota for this useful post:

    D Cell (15th December 2010)

Similar Threads

  1. Replies: 3
    Last Post: 23rd August 2010, 10:37
  2. keyboard event transfer
    By vijayabcdef in forum Qt Programming
    Replies: 3
    Last Post: 22nd July 2010, 06:54
  3. Additional keyboard shortcut for a menu
    By negritot in forum Qt Programming
    Replies: 5
    Last Post: 17th September 2009, 05:58
  4. Invoke QCompletion on keyboard shortcut
    By aspidites in forum Qt Programming
    Replies: 0
    Last Post: 30th August 2009, 10:32
  5. Rerouting messages for keyboard shortcut selection dialog.
    By andy.fillebrown in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2009, 18:55

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