qml 程序退出确认对话框
2016-06-13 12:09
363 查看
MessageDialog
{
id:myMsgbox
standardButtons: StandardButton.Yes | StandardButton.No
modality: Qt.ApplicationModal
title: "确认退出"
text:"你确定要退出商旅平台吗?"
onYes:
{
Qt.quit();
}
}
StackView {
id: stackView
anchors.fill: parent
focus: true
Keys.onReleased:{
if (event.key === Qt.Key_Back )
{
console.log("key pressed");
console.log("stackView.depth = "+stackView.depth);
if(stackView.depth > 1){
stackView.pop();
event.accepted = true;//消息不再往下传
}
else
{
myMsgbox.open();
event.accepted = true;//消息不再往下传
}
}
}
initialItem: {
Qt.resolvedUrl("qrc:///qml/UserInfo/QLogin.qml")
}}转载:http://blog.163.com/wslngcjsdxdr@126/blog/static/1621962302014817101237288/
相关文章推荐
- ios应用推广策略
- racktables 的介绍及搭建指南
- 剑指offer(23)-二叉搜索树与双向链表
- CSS3 Media 手机自适应
- 毕业论文格式汇总
- jboss7.1中配置log4j有效
- java并发编程(十)--多线程环境中安全使用集合API
- phpmailer简单发送邮件的方法(附phpmailer源码下载)
- CentOS配置FTP(VSFTPD)
- Android 时区设置以及设置系统属性的分析
- PHP array_key_exists检查键名或索引是否存在于数组中的实现方法
- 微信支付开发
- PHP基础阶段内容
- 图像识别中距离变换的原理及作用详解,并附用OpenCV中的distanceTransform实现距离变换的代码!
- sql server2008 r2 密钥
- objective-C之NSDate相关类(四)
- Android将Xamarin For VS升级为4.1.0.530版教程
- 使用Zxing 一维码
- View中页面是否处于最前端
- 几种工厂模式对比