Qt 5.10 for Android StackView 响应系统返回键

    

    StackView {
          id: stackview
          anchors.fill: parent
          initialItem: "qrc:/main/Default.qml"
          focus: true
          Keys.enabled: true
          Keys.onBackPressed: {
              event.accepted = true;
              if((appIdentity === 0 & depth === 2) | (appIdentity === 1 & depth === 4))
              {
                    mainMessage.showMessage();
              }
              else
              {
                pop();
              }

          }
}
原文地址:https://www.cnblogs.com/hbrw/p/8820301.html