This works for me and I'm using dual monitors.
#include <QtCore/QtCore>
#include <QtGui/QtGui>
int main(int argc, char** argv)
{
for (int i = 0; i < desktop.screenCount(); ++i) {
qDebug() << "Width: " << desktop.screenGeometry(i).width();
qDebug() << "Height: " << desktop.screenGeometry(i).height();
}
}
#include <QtCore/QtCore>
#include <QtGui/QtGui>
int main(int argc, char** argv)
{
new QApplication(argc, argv);
QDesktopWidget desktop;
for (int i = 0; i < desktop.screenCount(); ++i) {
qDebug() << "Width: " << desktop.screenGeometry(i).width();
qDebug() << "Height: " << desktop.screenGeometry(i).height();
}
return QApplication::exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks