Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get screen dimensions using Qt?

Tags:

graphics

qt

I need to obtain screen dimensions using Qt. I would think I'd use the Qt mobility apis here: http://doc.qt.nokia.com/qtmobility-1.0-tp/

But I see nothing that would obtain screen size (x/y). Am I missing something?

Thanks.

like image 855
glutz Avatar asked Dec 27 '22 18:12

glutz


1 Answers

Maybe the QDesktopWidget has what you need?

const QRect QDesktopWidget::screenGeometry ( int screen = -1 ) const
Returns the geometry of the screen with index screen. The default screen is used if screen is -1. See also screenNumber().

like image 135
aukaost Avatar answered Jan 08 '23 00:01

aukaost