Results 1 to 2 of 2

Thread: action with shortcut triggers in parent

  1. #1
    Join Date
    Jul 2012
    Posts
    240
    Thanks
    25
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default action with shortcut triggers in parent

    Hi,

    This is in Python 5.12, but the same applies to C++. I am writing a plugin for an C++ application that embeds python and PySide.
    All is working well, except when I register actions with a shortcut in my QTableView widget (tableview->addAction()), then the shortcut triggers in the parent application, rather than in my tableview. I have tried Qt::ShortcutContext, but they dont make a difference.


    I can hack up something with an eventFilter, but certainly there must be a better way?


    edit: ok, it only happens if a certain widget of the parent application has focus. so i am guessing they are doing funky stuff in event listeners or something and my only choice is to step down on that level too.
    Last edited by tuli; 4th March 2022 at 21:08.

  2. #2
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    680
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: action with shortcut triggers in parent

    How are you creating que QAction?

    The QWidget::addAction(QAction *action) documentation says that "The ownership of action is not transferred to this QWidget"

    Sincerely
    Franco Amato

Similar Threads

  1. Replies: 0
    Last Post: 3rd July 2014, 07:25
  2. find out which shortcut triggered action
    By qt_gotcha in forum Newbie
    Replies: 3
    Last Post: 23rd August 2010, 20:27
  3. Problem with action triggers
    By zuck in forum Qt Programming
    Replies: 2
    Last Post: 7th April 2009, 15:08
  4. Action shortcut
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 16th June 2008, 15:02
  5. MYSQL Triggers??
    By allensr in forum General Programming
    Replies: 1
    Last Post: 2nd October 2006, 21:54

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.