Results 1 to 4 of 4

Thread: find out which shortcut triggered action

  1. #1
    Join Date
    Jul 2009
    Posts
    92
    Thanks
    7
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default find out which shortcut triggered action

    I can't find how to see which shortcut triggered an action. I have a find/replace window and want certain widgets to be disabled when the user presses the replace keysequence and others when the find sequence is pressed
    thanks

  2. #2
    Join Date
    Dec 2007
    Posts
    27
    Thanks
    1
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: find out which shortcut triggered action

    You can construct two objects of type QShortcut and connect the activated method to a slot, where you enable / disable your widgets.
    Greetz Yakin

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

    Default Re: find out which shortcut triggered action

    I can't find how to see which shortcut triggered an action
    But you can always know which action was triggered using QObject::sender()

  4. #4
    Join Date
    Jul 2009
    Posts
    92
    Thanks
    7
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: find out which shortcut triggered action

    ok, thanks, makes sense.

Similar Threads

  1. QUdpSocket readyRead() signal not triggered
    By deionut in forum Newbie
    Replies: 2
    Last Post: 26th October 2010, 18:19
  2. Replies: 1
    Last Post: 11th April 2010, 14:21
  3. Capture the triggered event of MacWindowToolBarButtonHint
    By alexandersv in forum Qt Programming
    Replies: 0
    Last Post: 11th October 2009, 17:05
  4. Action shortcut
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 16th June 2008, 15:02
  5. No action checked in an exclusive action group
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 13th February 2006, 06:19

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.