Qt窗体居中显示方式
前言
我们在开发Qt软件过程中,经常会遇到窗口居中的问题,那我们如何使Qt窗体居中显示呢?
Qt窗体居中显示方法
引入头文件
#include <QDesktopWidget>
Qt窗体居中显示代码
QDesktopWidget *desktop = QApplication::desktop();
move((desktop->width()-this->width())/2,(desktop->height()-this->height())/2);
版权声明:
作者:小何
链接:https://ligo100.cn/houduanjishu/qt/136.html
来源:小何博客
文章版权归作者所有,未经允许请勿转载。
THE END
二维码
打赏
![](https://ligo100.cn/wp-content/uploads/2021/05/qq-jie-tu-20210505165730.png)
文章目录
关闭
洒墨坡![网站主](https://ligo100.cn/wp-content/themes/CorePress/static/img/zhan.svg)
来一波友链不,大佬
小何@洒墨坡![网站主](https://ligo100.cn/wp-content/themes/CorePress/static/img/zhan.svg)
可以呀 大佬