赞
踩
Qt获取当前屏幕大小
1、头文件
#include
2、代码
QScreen *screen = QGuiApplication::primaryScreen ();
QRect screenRect = screen->availableVirtualGeometry();
int width = (screenRect.width()-this->width())/2;
int height = (screenRect.height()-this->height())/2;
this->setGeometry(width,height,this->width(),this->height());
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。