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

setOverrideCursor has no effect when a modal dialog is up and the mouse is hovering over its non modal parent



    • Type: Bug
    • Status: Reported
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: 5.6.2
    • Fix Version/s: None
    • Component/s: QPA: Windows
    • Labels:
    • Environment:
      Windows 10 running Qt 5.6.2


      This has been observed on Windows 10. The scenario is a QMainWindow and a modal dialog with a button. Pressing the button will perform a long task that requires a cursor change. Calling setOverrideCursor() on the QApplication instance will properly change the cursor provided the mouse if over the modal dialog. However, if the mouse is over the QMainWindow instance and a button click is initiated on the modal dialog the cursor does not change. Please see example main.cpp.


      I was able to notice that in applyNewCursor() located in qwindowswindow.cpp the call to QWindowsContext::instance()->windowUnderMouse() returns NULL. So it seems that we need to check whether the passed in QWindow instance is modal or not and return true.


        1. main.cpp
          2 kB
        2. patch.txt
          0.5 kB
        3. qtbug61133_diag.diff
          4 kB
        4. qtbug61133_patch_diag.diff
          4 kB
        5. qtbug61133.zip
          2 kB

          Issue Links

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



              • Assignee:
                kleint Friedemann Kleint
                shapochniky Yan Shapochnik
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There is 1 open Gerrit change