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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3, 6.8
    • WebEngine
    • None
    • Linux/X11, macOS, Windows

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes