Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10427

QWidgetAction and synchronous QMenu = real problem

    XMLWordPrintable

Details

    • b4669b919048c1dbdac2b3e9b2e79f3d023aa078 (qt/qtbase/5.15)
    • DaVinci sprint 1, DaVinci sprint 3, Shovelling Snow

    Description

      There seems to be a problem with "compability" between those two classes:

      There are several post on the net about people being unable to exit the QMenu after being done using their custom widget. Calling QAction::triggered(), as suggested in the docs, doesn't seem to work.

      Some notable references:
      Ref: http://lists.trolltech.com/pipermail/qt-interest/2010-March/020001.html
      Ref: http://www.qtcentre.org/threads/20450-How-to-make-QMenu.exec()-return-a-QWidgetAction

      Some are therefore using hacks to do it, like passing QMenu to their custom implementation of QWidgetAction, and manipulating it from there, or using events, like forwarding mouseReleaseEvent(), hideEvent() or "Esc" keyevents...

      Here is a notable hackish solution: http://lists.trolltech.com/qt-interest/2007-06/thread00463-0.html

      I don't know whether this is a bug or not, but considering the fact that one only can find problems of this kind on the internet, and no decent solution, suggest this to be a problem.

      Regards,
      Davor

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            davor Davor Josipovic
            Votes:
            5 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes