Reputation: 257
How do I retrieve the current display resolution in Qt4 or Qt5? For example, if I have my display resolution set to 1366x768, then how do I obtain this value in my application?
Upvotes: 2
Views: 192
Reputation: 28553
One solution is to get the dimension of the QT desktop widget
#include
qDebug () << QApplication::desktop()->screenGeometry();
It gives back a QRect, which offers functions to get the height and the width.
Upvotes: 5