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

Qt webengine doesn't update cursor properly when entering/leaving widgets

XMLWordPrintable

    • Linux/X11, macOS, Windows
    • 5043f4ddf (dev), 76b5ab01a (6.8), b4f039de4 (6.7)

      Please use this code to reproduce. It's simply a div with wait cursor on the left. When hover mouse in left, the cursor becomes wait cursor. But when moving to the right, the cursor is still wait cursor.
      Expect when leaving blue area, mouse cursor becomes normal. when entering blue area, mouse cursor becomes wait.
      Screen record: 2024-04-01 17-06-22.mp4

      <!DOCTYPE html>
      <html>
      <head>
      <style>
      body {
        margin: 0px;
        padding: 0px;
      }
      .wait {
        cursor: wait;
        width: 400px;
        height: 600px;
        background: blue;
      }
      </style>
      </head>
      <body>
      <div width="400px" height="600px" class="wait"></div>
      </body>
      </html>
      
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QWidget>
      #include <QtWebEngineWidgets/QWebEngineView>
      #include <QtQuick/QQuickWindow>
      
      
      int main(int argc, char** argv)
      {
      	QApplication app(argc, argv);
      
      	// tlw: red.
      	QWidget tlw;
      	tlw.resize(800, 600);
      	tlw.setStyleSheet("QWidget { background-color: red; }");
      
      	// webengine
      	QWebEngineView webengine(&tlw);
      	webengine.setGeometry(0, 0, 400, 600);
      	webengine.setUrl(QUrl::fromLocalFile("C:/temp/wait.html"));
      
      	tlw.show();
      	return app.exec();
      }
      

      There are some changes between 6.2 and 6.5 related to cursor. 6.2 calls QWidget::setCursor() to update the cursor. 6.5 calls QQuickItem::setCursor() to update the cursor.

        For Gerrit Dashboard: QTBUG-123889
        # Subject Branch Project Status CR V

            moheim Moss Heim
            mingxiang Mingxiang Xu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes