Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
None
-
5.8.0
-
Windows. Qt 5.8.0
Description
For instance following settings for main window
setMinimumSize(0, 0);
setMaximumSize(800, QWIDGETSIZE_MAX);
will result on warning
QWindowsWindow::setGeometry: Unable to set geometry 800x1200+18+40 on QWidgetWindow/'SetGeometryDpTestClassWindow'. Resulting geometry: 800x1174+18+40 (frame: 8, 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 0x0, maximum size: 800x16777215).
Using values for maximum height up to QWIDGETSIZE_MAX - 1 will work fine. My finding was that on function QWindowsGeometryHint::applyToMinMaxInfo there is a test for
if (maximumHeight < QWINDOWSIZE_MAX)
mmi->ptMaxTrackSize.y = maximumHeight + frameHeight;
which could be cause. Using comparison <= will fix the warning. But is that a correct fix? Anyway the documentation states that values up to QWINDOWSIZE_MAX should work.