Dialog QML Type
本地对话框的基类。更多
Import Statement: | import Qt.labs.platform |
Inherits: | |
Inherited By: | ColorDialog, FileDialog, FolderDialog, FontDialog, and MessageDialog |
属性
- data : list<QtObject>
- flags : Qt::WindowFlags
- modality : Qt::WindowModality
- parentWindow : Window
- result : int
- title : string
- visible : bool
信号
方法
详细说明
Dialog 类型为本地平台对话框提供了通用的 QML API。
要显示本地对话框,只需构建一个具体 Dialog 实现的实例,设置所需的属性,然后调用open() 即可。当用户完成对话框操作时,对话框会发出accepted() 或rejected() 。
注意: Qt.labs 模块中的类型不保证在未来版本中保持兼容。
属性文档
flags : Qt::WindowFlags |
该属性保存对话框的窗口标志。默认值为Qt.Dialog
。
modality : Qt::WindowModality |
该属性用于保存对话框的模式。默认值为Qt.WindowModal
。
可用值:
常量 | 说明 |
---|---|
Qt.NonModal | 对话框不是模式对话框,不会阻止其他窗口的输入。 |
Qt.WindowModal | 对话框对单个窗口层次结构是模式,并阻止对其父窗口、所有祖窗口以及父窗口和祖窗口的所有同级窗口的输入。 |
Qt.ApplicationModal | 对话框对应用程序是模态的,并阻止对所有窗口的输入。 |
result : int |
该属性显示结果代码。
标准结果代码:
常量 | 值 |
---|---|
Dialog.Accepted | |
Dialog.Rejected |
注: MessageDialog 将结果设置为点击的标准按钮的值,而不是使用标准结果代码。
title : string |
该属性用于保存对话框的标题。
信号文档
void accepted() |
void rejected() |
方法文档
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.