Results 1 to 3 of 3

Thread: Shorcuts for disabled QActions

  1. #1
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Shorcuts for disabled QActions

    I notice that even though a QAction is disabled, shortcut keys will still trigger them. This causes a few segfaults if I don't use extra checks in my code. Is this a bug, or is there an option I missed?
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Shorcuts for disabled QActions

    Use QAction::blockSignals( true ) while the actions are disabled.
    After that unblock them.

    Regards

  3. The following user says thank you to marcel for this useful post:

    Michiel (23rd May 2007)

  4. #3
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Shorcuts for disabled QActions

    Works for me. Thanks!

    I think a disabled action shouldn't send out signals by default, though.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

Similar Threads

  1. Problems with QActions and Pixmaps
    By ToddAtWSU in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2007, 22:53

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.