Results 1 to 7 of 7

Thread: Same shortcut for different actions in different widgets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Same shortcut for different actions in different widgets

    Quote Originally Posted by totem View Post
    I guess QSignalMapper would do the trick, but I never really got how it works.. nor I spent time trying to get it.
    Take a look at Qt MDI example, it's used here
    Ok, having had a look at it, I don't think this is what I am after. It seems to me that QSignalMapper is used in the MDI example to get the MDI child windows activated. Also with regards to the 'shared' actions, I want to be able to have different tooltips, etc. and I can't see how QSignalMapper can address that.

    Quote Originally Posted by nightghost View Post
    See Qt::ShortcutContext for this and add the actions to the correct widgets!
    I tried that earlier, but maybe didn't do it right. Will try again...

    Quote Originally Posted by Zlatomir View Post
    My opinion is that you should re-think the keyboard shortcuts and note that for many of us (and likely many of your users) Ctrl+C means copy.

    And put your self in the "user" perspective, would you like to use an application which uses Ctrl+C all over the place and each time you press the key combination does a different thing depending on which widget has focus?
    You clearly haven't read my message. Try again.
    Last edited by agarny; 30th March 2011 at 17:27.

Similar Threads

  1. Can i add Actions to QDockWidget
    By ladiesfinger in forum Qt Programming
    Replies: 4
    Last Post: 30th January 2011, 15:11
  2. help with QSignalMapper and actions
    By andreime in forum Newbie
    Replies: 1
    Last Post: 9th August 2009, 18:24
  3. Replies: 2
    Last Post: 31st July 2009, 09:18
  4. Spacing widgets and actions in a toolbar
    By indifference in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2007, 22:59
  5. Actions and what to do with them?
    By krsmichael in forum Qt Tools
    Replies: 2
    Last Post: 20th January 2006, 22:08

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.