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

Setting a layout on a QDialog produces warning

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2.4
    • QPA: Windows
    • None
    • Windows

    Description

      The provided example produces this warning:

      QWindowsWindow::setGeometry: Unable to set geometry 22x22-1300+676 (frame: 38x61-1308+645) on QWidgetWindow/"QDialogClassWindow" on "\\.\DISPLAY3". Resulting geometry: 54x22-1300+676 (frame: 70x61-1308+645) margins: 8, 31, 8, 8 minimum size: 22x22 MINMAXINFO(maxSize=POINT(x=0, y=0), maxpos=POINT(x=0, y=0), maxtrack=POINT(x=0, y=0), mintrack=POINT(x=38, y=61))) 

       

      It goes away when setting a minimum size on the dialog for this simple example but for my use case in a more complicated setup it is triggered by having a QLabel with word wrap enabled which I seem to not be able to get away from.

       

      I debugged it a bit and there seems to be a mismatch between the QWindows understanding of the geometry and the platform window.

       	qwindowsd.dll!QWindowsBaseWindow::setGeometry_sys(const QRect & rect) Line 2125	C++
       	qwindowsd.dll!QWindowsWindow::setGeometry(const QRect & rectIn) Line 1989	C++
       	Qt6Guid.dll!QWindow::setGeometry(const QRect & rect) Line 1763	C++
       	Qt6Guid.dll!QWindow::setPosition(const QPoint & pt) Line 1898	C++
       	Qt6Guid.dll!QWindow::setPosition(int posx, int posy) Line 1910	C++
       	Qt6Widgetsd.dll!QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) Line 7144	C++
       	Qt6Widgetsd.dll!QWidget::move(const QPoint & p) Line 6989	C++
       	Qt6Widgetsd.dll!QDialog::adjustPosition(QWidget * w) Line 967	C++
       	Qt6Widgetsd.dll!QDialog::showEvent(QShowEvent * event) Line 870	C++
      
      

      In this callstack setGeometry on the widget is called with the correct size, but in the QWindow::setPosition the size returned is wrong, I assume its the size before the layout has been evaluated.

      Attachments

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

        Activity

          People

            owolff Oliver Wolff
            cyriuz Viktor Arvidsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes