Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Get Desktop Geometry, on the actual monitor, WITHOUT the Taskbar



  • Greetings,

    I would like to know if there's a way to get the desktop width & height that doesn't include the taskbar on Windows (and whatever the name you give it on other OSes)?

    I've tried to get it with QApplication::desktop()->availableGeometry(), but if my screen resolution is 1920x1200, it return me 1920x1200... not a smaller view that doesn't include the taskbar.

    thanks
    Christian



  • The following code works for me:
    @QRect screenGeometry = QApplication::desktop()->availableGeometry();
    qWarning("availableGeometry: %dx%d", screenGeometry.width(), screenGeometry.height());@

    Output:
    @availableGeometry: 1920x1040@



  • Not for me... it give me 1200 lines while it should be approx 1130 because the taskbar take some space.



  • For what it's worth: I'm using Qt 4.8.3 on Windows 7 (MSVC 2010).


Log in to reply