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();
              }

          }
}
posted @ 2018-04-13 14:48  Mtr1994  阅读(509)  评论(0编辑  收藏  举报