Qt 窗体最小化、最大化设置

前言 需求: 我想在软件一打开就以最大化方式显示。 实现方法 // 窗体最大化 this->setWin […]

前言

需求: 我想在软件一打开就以最大化方式显示。

实现方法

//  窗体最大化
this->setWindowState(Qt::WindowMaximized);

// 后面参数可以设置的值
enum WindowState {
        WindowNoState    = 0x00000000,
        WindowMinimized  = 0x00000001,
        WindowMaximized  = 0x00000002,
        WindowFullScreen = 0x00000004,
        WindowActive     = 0x00000008
 };

 

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.
版权声明
文章标题:Qt 窗体最小化、最大化设置
文章链接:https://blog.chiyuba.com/houduanjishu/qt/86.html
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布,转载或引用请注明出处。
温馨提示:本文最后更新于 2021年6月9日,部分内容可能存在时效性,请注意甄别。

相关推荐

更多教程
Qt 精确获取滑动条鼠标按下处的值 Qt Qt 精确获取滑动条鼠标按下处的值

前言 在Qt开发过程中,我们有时候可能会...

13 浏览
QCryptographicHash类使用 Qt QCryptographicHash类使用

前言 最近项目中有个需求:判断一个编辑界...

18 浏览
QTableView setSortingEnabled后setStretchLastSection失效 Qt QTableView setSortingEnabled后setStretchLastSection失效

QTableView 不设置setSec...

18 浏览

评论