Qt获取屏幕分辨率

 

#include <QtWidgets/QApplication>
#include <QRect>

QDesktopWidget *qDesktopWidget= QApplication::desktop();
QRect qrect1 = qDesktopWidget->screen(0)->rect();
qDebug() << "width:" << qrect1.width() << "     height:" << qrect1.height();

 

posted @ 2019-08-04 11:06  西北逍遥  阅读(732)  评论(0编辑  收藏  举报