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

Popup without explicit closePolicy closes App on Android BACK key

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9.0 RC
    • 5.8.0
    • Quick: Controls 2
    • None
    • Qt 5.8
      QQC2 2.1
    • Android
    • 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

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

        Activity

          People

            Unassigned Unassigned
            ekkescorner Ekkehard
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes