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

Mouse cursor become fixed (always default) after show menu in a scene

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.1
    • 5.6.0
    • Widgets: GraphicsView
    • Ubuntu 16.04, 64 bit
    • e4fb521b3f3b9e59146b7569b72aee08dbaeb268

    Description

      Please see screencast - https://youtu.be/sFPtfhPOLyc. With 5.5.1 all works fine. Example:

      #include <QApplication>
      #include <QMenu>
      #include <QGraphicsScene>
      #include <QGraphicsView>
      #include <QLabel>

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);

      QLabel* l = new QLabel( "test" );
      l->setCursor( Qt::PointingHandCursor );

      l->setContextMenuPolicy( Qt::CustomContextMenu );
      QObject::connect( l, &QWidget::customContextMenuRequested, []

      { QMenu m; m.addAction( "test" ); m.exec( QCursor::pos() ); }

      );

      QGraphicsScene scene;
      scene.addWidget( l );

      QGraphicsView graphicsView;
      graphicsView.setScene(&scene);

      graphicsView.show();

      return app.exec();
      }

      Attachments

        1. main.cpp
          0.6 kB
        2. qtbug.pro
          0.3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            zaps166 Błażej Szczygieł
            igornikitin Igor
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes