您的位置:首页 > 编程语言 > Qt开发

QT 如何使窗体初始最大化

2012-08-12 10:22 190 查看
今天我想让一个窗体初始运行最大化,本以为很简单一个问题,花了差不多两个小时才解决,真是痛苦,

问题一但解决,其实非常简单

QT 中有一个

void QWidget::setWindowState ( Qt::WindowStateswindowState )

这样的函数,通过它可以设置窗体的初始状态,Qt::WindowStates 一共有下面几种状态:

ConstantValueDescription
Qt::WindowNoState0x00000000The window has no state set (in normal state).
Qt::WindowMinimized0x00000001The window is minimized (i.e. iconified).
Qt::WindowMaximized0x00000002The window is maximized with a frame around it.
Qt::WindowFullScreen0x00000004The window fills the entire screen without any frame around it.
Qt::WindowActive0x00000008The window is the active window, i.e. it has keyboard focus.
有了这个就非常easy 了,想让窗体最大化,只需要

setWindowState(Qt::WindowMaximized);就行了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: