Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Use QDesktopwidget::availableGeometry to show QMainWindow maximized
MvHorssen last edited by
I'm building a QT application for Windows 7, using MinGW. In my code, I have a class derived from QMainWindow. This mainwindow is showed and closed several times (over different screens). I'm showing the window using the following code:
Only the first time when this code is exectued, the window is showed as expected. The next times, the window is showed maximized, but i'm missing a few pixels at the bottom of the screen.
I also receive a warning in QT, when the code is executed:
setGeometryDp: Unable to set geometry 1600x1172+0+0 on QWidgetWindow/'CDisplayClassWindow'. Resulting geometry: 1600x1150+0+22 (frame: 8, 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 780x539, maximum size: 16777215x16777215).
What i don't understand is that the geometry returned by desktop() >availableGeometry looks like to be incorrect. My question is, how can i determine the geometry showed in the warning message?(1600x1150+0+22)