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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.6.2
    • Fix Version/s: 5.8.0
    • Component/s: Quick: Widget
    • Labels:
      None
    • Commits:
      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

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

          Activity

            People

            Assignee:
            kkohne Kai Köhne
            Reporter:
            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