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

QtQuickControls2 Drawer doesn't close if tapped outside



    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.9.0
    • Fix Version/s: 5.9.2
    • Component/s: Quick: Controls 2
    • Labels:
    • Environment:
      OSX 10.12.5
      Qt 5.9
      QtCreator 4.3
      Android 6.0.1
      iOS 10.3.2
      Xcode 8.3.3

      bug appears on Android and iOS but is working by mouse click on macOS
    • Commits:


      under 5.8 opening the Drawer I always could close the Drawer by tapping outside of the Drawer

      under 5.9 the (opened) Drawer looks the same (space outside Drawer is dimmed),

      but tapping outside doesn't always close the Drawer.

      sometimes after some taps, sometimes never, sometimes immediately

      under iOS I'm getting this after opening the Drawer by dragging:

      {{stale focus object QQuickStackView_QML_26(0x17013b080) , doing manual update}}

      and this after some taps outside drawer if I was able to close the Drawer:

      {{stale focus object QQuickPopupItem(0x17022d4e0) , doing manual update}}
      {{stale focus object QQuickRootItem(0x17002e700) , doing manual update}}

      under Android no output like this

      on MacOS clicking with Mouse works, so it's a touch problem

      I verified comparing QtQuickControls2 Gallery APP from 5.8: tap outside Drawer closes Drawer,  Gallery from 5.9: tap outside doesn't close the Drawer

      tried explicitely setting modal true or some other close policies, but Drawer wasn't closed reliable

      while the Drawer cannot be closed tapping outside, the tap event goes through to the underlying Page and so user can hit a Button by accident.

      Found a (ugly looking) workaround and inserted a fake Popup between Drawer and underlying StackView Pages. Now user cannot tap on Buttons from Pages below, but unfortunately also cannot "see" the content below. couldn't figure out a way to make this fake Popup transparent


      Drawer {
          id: myDrawer
          z: 1
          // workaround:
          onOpened: {
          onAboutToHide: {
          Popup {
              id: fakePopup
              z: 0
              width: appWindow.width
              height: appWindow.height
          // end workaround


          Issue Links

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



              • Assignee:
                ekkescorner Ekkehard
              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There are no open Gerrit changes