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

Menu key and widgets embedded in a graphics view

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.6.0
    • 4.5.0
    • Widgets: GraphicsView
    • None
    • 0054b444a202d08167c49a1a94fd2d306d14f91f

    Description

      To reproduce, run the test case below and:

      • set the keyboard focus onto the line edit
      • press the menu key (the one between the window and the ctrl key) 5 times
      • try to close the context menu

      One needs to select something 5 times or press the escape key five
      times. This is because the menu was actually opened five times. This does not happen with
      ordinary widgets.

      // --------------------------------------
      #include <QApplication>
      #include <QGraphicsView>
      #include <QGraphicsProxyWidget>
      #include <QLineEdit>
      
      int main (int argc, char **argv)
      {
        QApplication app (argc, argv);
      
        QGraphicsView *view = new QGraphicsView;
        QGraphicsScene *scene = new QGraphicsScene;
      
        scene->setSceneRect (0, 0, 100, 100);
        view->setScene (scene);
      
        QGraphicsProxyWidget *pw = new QGraphicsProxyWidget;
        pw->setWidget (new QLineEdit);
        scene->addItem (pw);
      
        view->show ();
      
        int res = app.exec ();
      
        delete view;
        delete scene;
      
        return res;
      }
      // --------------------------------------
      

      Attachments

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

        Activity

          People

            menard Alexis Menard (closed Nokia identity) (Inactive)
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes