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