Qt获取屏幕分辨率

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

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

原文地址:https://www.cnblogs.com/herd/p/11297558.html