This works for me and I'm using dual monitors.

Qt Code:
  1. #include <QtCore/QtCore>
  2. #include <QtGui/QtGui>
  3.  
  4. int main(int argc, char** argv)
  5. {
  6. new QApplication(argc, argv);
  7.  
  8. QDesktopWidget desktop;
  9. for (int i = 0; i < desktop.screenCount(); ++i) {
  10. qDebug() << "Width: " << desktop.screenGeometry(i).width();
  11. qDebug() << "Height: " << desktop.screenGeometry(i).height();
  12. }
  13.  
  14. return QApplication::exec();
  15. }
To copy to clipboard, switch view to plain text mode