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

QML MouseArea cursorShape not set if the mouse cursor is on top of application when first started

XMLWordPrintable

      Minimal example:

      import QtQuick 2.2
      
      Rectangle {
          width: 360
          height: 360
          MouseArea {
              anchors.fill: parent
              hoverEnabled: true;
              onPositionChanged: {
                  cursorShape = Qt.BlankCursor;
                  console.log("set blank cursor", cursorShape);
              }
          }
      }
      

      Expected: That the mouse cursor is set to blank when the mouse position is changed over the application window, independent of its position when the application starts.
      Reproduce: Start the app with the cursor already positioned where the rectangle will show up when the application first appears. Move the mouse and the log will report correctly that the cursor shape is set to "10", but it will not be visually blank. If, on the other hand, the cursor is moved out from the window and back in again then everything works as expected (the cursor disappears).

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            davidgr David Bredström
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes