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

前言

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

实现方法

//  窗体最大化
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.

版权声明:
作者:小何
链接:https://ligo100.cn/houduanjishu/qt/86.html
来源:小何博客
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
< <上一篇
下一篇>>
文章目录
关闭
目 录