QT 如何使窗体初始最大化
2012-08-12 10:22
190 查看
今天我想让一个窗体初始运行最大化,本以为很简单一个问题,花了差不多两个小时才解决,真是痛苦,
问题一但解决,其实非常简单
QT 中有一个
有了这个就非常easy 了,想让窗体最大化,只需要
setWindowState(Qt::WindowMaximized);就行了
问题一但解决,其实非常简单
QT 中有一个
void QWidget::setWindowState ( Qt::WindowStateswindowState )
这样的函数,通过它可以设置窗体的初始状态,Qt::WindowStates 一共有下面几种状态:Constant | Value | Description |
---|---|---|
Qt::WindowNoState | 0x00000000 | The window has no state set (in normal state). |
Qt::WindowMinimized | 0x00000001 | The window is minimized (i.e. iconified). |
Qt::WindowMaximized | 0x00000002 | The window is maximized with a frame around it. |
Qt::WindowFullScreen | 0x00000004 | The window fills the entire screen without any frame around it. |
Qt::WindowActive | 0x00000008 | The window is the active window, i.e. it has keyboard focus. |
setWindowState(Qt::WindowMaximized);就行了
相关文章推荐
- Qt如何使窗体初始最大化
- QT 如何使窗体初始最大化
- QT窗体初始最大化
- Qt窗体关闭时,如何自动销毁窗体类对象
- vs2013使用qt设计师创建新窗体后如何关联资源文件
- 通过鼠标事件来看QT/Embedded 窗体事件是如何派发的
- 如何在初始化窗体不是最大化情况下,获取最大化窗体的客户区的尺寸
- 教你如何用Qt做透明的窗体,setMask, Opacity
- 多文档的MFC中,如何去掉菜单栏,父窗体,子窗体最大化显示,关闭子窗体是去掉保存提示
- QT中如何设置窗体的背景图片。
- Qt设计dialog窗口的最大化和控件随窗体的改变
- QT实现无边框窗体的最小化,最大化/还原,关闭,拖动和双击最大化等功能
- 教你如何用Qt做透明的窗体,setMask,Qt,Opacity
- Qt 窗体最大化、最小化时的事件触发
- QT中如何设置窗体的背景图片
- 通过鼠标事件来看QT/Embedded 窗体事件是如何派发的
- 窗体最大化的时候,如何指定窗体的位置、大小(C#)
- VC2010 程序如何初始最大化
- Qt窗体关闭时,如何自动销毁窗体类对象
- c#中如何让form窗体最大化