Important: Please read the 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.


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

    @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