QT: Get the available size of the screen

    QScreen *screen=QGuiApplication::primaryScreen ();
    
    QRect rect=screen->availableGeometry() ;

The primaryScreen() property holds the application's primary (or default) screen.
Unless otherwise stated, this will be the screen that initially displays QWindows.
The availableGeometry() property holds the screen's available geometry (in pixels).
Available geometry is the geometry that does not include the window manager's reserved areas such as the taskbar and system menus.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324208166&siteId=291194637