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

Windows: QGuiApplication::setOverrideCursor does not work properly in QML application



    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.10.1
    • Fix Version/s: 5.11.0 Beta 3
    • Component/s: QPA: Windows
    • Labels:
    • Environment:
      Windows 10 pro
    • Commits:
      2823cc6d4b24b26f82c991c532b749baa9dbb3a7 (qtbase/5.11, 5.4.2018, 5.11)


      I have a quite complex QML application where I need to change the application cursor shape.
      Because of the complexity, I do not have the possibility to handle the cursor shape by using only MouseAreas.

      I tried to find a solution by checking the Qt documentation but it seems that there is no way to do it directly in QML.
      Anyway I read that it is possible to use setOverrideCursor() and restoreOverrideCursor() QGuiApplication methods.
      I tried to use them in my application but I found two problems happening after calling setOverrideCursor():

      1) When I move the mouse cursor over a QML MouseArea that changes the cursor shape when it is hovered on, the cursor shape does not change.
      This is annoying especially in case of resize handles, but it is not blocking like problem #2.

      2) When I move the mouse cursor outside the Window and come back inside it, the override cursor shape is not restored.

      In the attached example call setOverrideCursor() by clicking on the upper button.
      After that, try to move the cursor on the red rectangle and notice that Qt.SizeHorCursor is not shown (problem #1).
      Now try to move cursor outside the window, move back inside it and notice the override cursor is not restored (problem #2).


        1. ApplicationCursor.zip
          3 kB
        2. qtbug67467_diag.diff
          8 kB
        3. qtbug67467_log.txt
          0.7 kB
        4. qtbug67467.zip
          3 kB

          Issue Links

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



              kleint Friedemann Kleint
              n.peroni Nicola Peroni
              0 Vote for this issue
              2 Start watching this issue



                  Gerrit Reviews

                  There are no open Gerrit changes