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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.0 Beta 3
    • 5.10.1
    • QPA: Windows
    • None
    • Windows 10 pro
    • 2823cc6d4b24b26f82c991c532b749baa9dbb3a7 (qtbase/5.11, 5.4.2018, 5.11)

    Description

      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).

      Attachments

        1. ApplicationCursor.zip
          3 kB
          Nicola Peroni
        2. qtbug67467_diag.diff
          8 kB
          Friedemann Kleint
        3. qtbug67467_log.txt
          0.7 kB
          Friedemann Kleint
        4. qtbug67467.zip
          3 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes