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

Popup without explicit closePolicy closes App on Android BACK key

    Details

    • Commits:
      49163ca689562a4a000490fb137e5c9533684471

      Description

      If no explicit closePolicy is set, hitting the BACK Key on Android quits the APP. There's no way to catch the BACK Key.
      Qt 5.7 and QQC2.0 works well - it happens with new default closePolicy in 5.8
      Here's to test:

      import QtQuick 2.7
      import QtQuick.Controls 2.1
      import QtQuick.Layouts 1.3
      import QtQuick.Controls.Material 2.1
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
      
          Page {
              id: thePage
              anchors.fill: parent
      
              Label {
                  id: theLabel
                  text: "Close Policy Test"
                  anchors.centerIn: parent
              }
      
              Button {
                  anchors.top: theLabel.bottom
                  text: "Popup BACK KEy Test"
                  onClicked: {
                      thePopup.open()
                  }
              }
      
      
              Popup {
                  id: thePopup
                  // closePolicy: Popup.CloseOnPressOutside
                  width: 200
                  height: 200
                  Label {
                      text: "Press BACK Key"
                  }
              }
      
              Keys.onBackPressed: {
                  event.accepted = true
                  theLabel.text = "BACK KEY consumed"
              }
      
      
          } // page
      }
      
      

        Attachments

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

          Activity

            People

            • Assignee:
              jpnurmi J-P Nurmi
              Reporter:
              ekkescorner Ekkehard
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes