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

'What's this' help breaks QtQuick.Window (type:Qt.dialog)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.8.0
    • 5.6.2
    • Quick: Widget
    • None
    • 9d696af6cd45ee95c155829999b8184229f9bc72

    Description

      A QtQuick.Window with type Qt.dialog will show a '?' button on Windows.
      Clicking on it will change the mouse cursor. However, since handling of 'What's This' is not implemented, the mouse cursor will never change back.

      Problem analysis:

      • '?' button because, in the Windows platform plugin, Qt::WindowContextHelpButtonHint is set for top-level windows with flag Qt::Dialog.
      • If the user clicks the '?' button a EnterWhatsThisMode is created (see QWindowSystemInterface::handleEnterWhatsThisEvent)
      • QApplication::event handles QEvent::EnterWhatsThisMode by calling QWhatsThis::enterWhatsThisMode();
      • QWhatsThis only forwards events to top level QWidgets (QApplication::topLevelWidgets()). So even if QWindow / QQuickWindow would add event handlers for QEvent::QueryWhatsThis, QEvent:WhatsThis it would not be delivered

      Workaround:

      Explicitly disable Qt::WindowContextHelpButtonHint for QtQuick.Window objects

      Window {
          flags: Qt.Dialog
      
          Component.onCompleted: {
              flags = flags & ~Qt.WindowContextHelpButtonHint
          }
          // ...
      }
      

      Attachments

        1. QTBUG-56239.zip
          1 kB
          Kai Köhne
        For Gerrit Dashboard: QTBUG-56239
        # Subject Branch Project Status CR V

        Activity

          People

            kkohne Kai Köhne
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes