Qt中设置对话框的属性
2012-08-13 09:35
459 查看
因为最近才深入的使用Qt,所以很多常用的属性还不知道怎么设置。今天在写Qt中的弹出对话框的时候,对话框是出来了,但是没处理完对话框,点击对话框以外的窗体位置还是可以和主窗体交互,我记得在winForm编程的时候,应该设置主窗体之类的。而在Qt下称为模态和非模态对话框。
对应的英文文档为:
This enum specifies the behavior of a modal window. A modal window is one that blocks input to other windows. Note that windows that are children of a modal window are not blocked.
The values are:
属性设置:dialog->setWindowModality(Qt::ApplicationModal);
对应的英文文档为:
enum Qt::WindowModality
This enum specifies the behavior of a modal window. A modal window is one that blocks input to other windows. Note that windows that are children of a modal window are not blocked.The values are:
Constant | Value | Description |
---|---|---|
Qt::NonModal | 0 | The window is not modal and does not block input to other windows. |
Qt::WindowModal | 1 | The window is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows. |
Qt::ApplicationModal | 2 | The window is modal to the application and blocks input to all windows |
Constant | Value | Description |
---|---|---|
Qt::NonModal | 0 | 非模态,可以和程序的其它窗体交互。 |
Qt::WindowModal | 1 | 窗体模态,程序在未处理完对话框时将阻止和对话框的父窗体、父父窗体以及父窗体的兄弟姐妹窗体及其父窗体交互。 |
Qt::ApplicationModal | 2 | 应用程序模态,阻止和任何其它窗体进行交互。 |
相关文章推荐
- 如果你想用对话框代替一个activity的话,可以设置activity的主题属性
- QML与c++交互学习笔记(八) qt c++直接调用QML中的函数, 直接设置属性
- QML与c++交互学习笔记(八) qt c++直接调用QML中的函数, 直接设置属性
- QT的一个奇怪问题,设置了Qt::Tool后,点击弹出对话框的确定取消按钮,程序直接退出
- 此数据库没有有效所有者,因此无法安装数据库关系图支持对象。若要继续,请首先使用“数据库属性”对话框的“文件”页或ALTER AUTHORIZATION语句将数据库所有者设置为有效登录名,然后再添加数据库关系图支持对象
- QML与c++交互学习笔记(八) qt c++直接调用QML中的函数, 直接设置属性
- Qt 下 QtableView的属性设置
- Qt按钮为什么设置了三态点击样式效果,无法得到预期,enabled属性为何无法选中 - C/C++解惑之Qt
- Qt 设置对话框背景
- 浅谈:切换视时基于FormView的对话框属性设置与ASSERT报错的问题
- QT的一个奇怪问题,设置了Qt::Tool后,点击弹出对话框的确定取消按钮,程序直接退出。
- QT的一个奇怪问题,设置了Qt::Tool后,点击弹出对话框的确定取消按钮,程序直接退出
- Activity设置为对话框属性时(Theme.Dialog)时,改变其在屏幕中的位置
- 切换视时基于FormView的对话框属性设置与ASSERT报错的问题 (Debug Assertion Failed!)
- SWT对话框属性设置
- qt中lineedit的几个属性设置
- QT设置文件对话框
- Qt 设置按钮透明、图标、移动到按钮和状态栏提示等各种属性
- Qt qml TextField TextInput等文本输入控件中validator属性的设置
- Qt之设置文件的读写属性