Results 1 to 6 of 6

Thread: QWidgetAction refuse to disappear on trigger()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QWidgetAction refuse to disappear on trigger()

    Hi Dave,

    Don't know whether this will solve the problem with your app but it works on your example. I got the menu to hide when the pushbutton is clicked by doing the following:
    Changed the connect statement in TestAction::createWidget() to this:
    Qt Code:
    1. connect(wgt->btn, SIGNAL(clicked()), this, SIGNAL(triggered()));
    To copy to clipboard, switch view to plain text mode 
    Created "menu" on the heap in MainWindow::contextMenuEvent() and added this connect statement:
    Qt Code:
    1. connect(te, SIGNAL(triggered()), menu, SLOT(hide()));
    To copy to clipboard, switch view to plain text mode 

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

    dave (23rd May 2010)

  3. #2
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidgetAction refuse to disappear on trigger()

    It works. but now exec return NULL. Will have to work around it. I really start to wonder if it is a bug int Qt or I'm just not using it right...

Similar Threads

  1. QWidgetAction resize in QMenu
    By stburton in forum Qt Programming
    Replies: 7
    Last Post: 11th January 2018, 14:27
  2. How to make QMenu.exec() return a QWidgetAction
    By gregsan in forum Qt Programming
    Replies: 5
    Last Post: 15th April 2010, 00:04
  3. Replies: 0
    Last Post: 16th March 2010, 12:24
  4. QToolBar, QWidgetAction, QWidget
    By prof.ebral in forum Newbie
    Replies: 3
    Last Post: 18th February 2010, 19:38
  5. QWidgetAction: A QTreeWidget in a QMenu
    By chezifresh in forum Qt Programming
    Replies: 1
    Last Post: 16th October 2009, 03:49

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.