[SOLVED] Get the availableGeometry of monitor WITH the taskbar on Windows
-
While in the showMaximized mode, I'm trying to set a background image to my mainwindow by obtaining the size of the screen using
@
QRect rect = desktopWidget->availableGeometry();
@But this returns the size of the screen excluding the taskbar. I read in the documentation that if int screen = -1 then the whole screen would be considered. Where do I specify the parameter? I tried
@
QRect rect = desktopWidget->availableGeometry(int screen = -1);
@and
@
int screen = -1;
QRect rect = desktopWidget->availableGeometry(screen);
@But I suppose the above two methods are syntactically wrong. Could someone please help me in this regard?
Thanks. -
Yes, according to the documentation that method should indeed return the full resolution of the display. Having the parameter "= -1" simply sets a "default" value to call the method without any parameter and use -1.
Keeping in mind 99.99% of the screens out there are with standard resolutions or aspect ratios, you could easily calculate the actual size.