Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-60252

Using QWINDOWSIZE_MAX results to warning Unable to set geometry

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mmutz Marc Mutz
            misalmel Mika Salmela
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes