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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.6.2
    • QPA: Windows
    • None
    • Windows 10 running Qt 5.6.2

    Description

      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.

      Attachments

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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: