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

[REG] 5.9.4->5.11 QWidget::show breaks previous setGeometry/restoreGeometry



    • Windows
    • 6fb2b4b271dba6f8b47bf66c50b30ce6df567178 (qt/qtbase/5.12)


      Central simple code that fails include:

      QWidget *w = new QWidget();
      w->setGeometry(60, 60, 800, 800); // legal coordinates
      w->show(); // Widget is shown outside visible area :(

      Attached example and output from qtdiag (important - and especially two monitors with different dpi seems to be needed).

      When I start the program from the primary screen in Qt 5.12.3 the child window does not show. (The geometry is ruined on show). It works setting the geometry again. (In the menu select 3rd item 'set child geometry'). Now the dialog is where it should be correctly shown

      (After show it got the wrong geometry QRect(-1800,120 1600x1600))

      After that we can store geometry (which includes destruction of the widget). Then we can restore the widget, which likely invokes setGeometry and show will again ruin everything and the dialog will go missing.

      I have seen other issues in 5.9.4 (e.g restoring after showing can cause some side effects here, but the example code runs just fine in 5.9.4). Using multiple monitors is no longer rare and actually is quite common to have an older (with  dpr=1) and a newer one (dpr=2).


        1. qtbug75940_log.txt
          2 kB
        2. qtbug75940.zip
          2 kB
        3. qtdiag_info.txt
          7 kB
        4. storeRestoreBug.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            kleint Friedemann Kleint
            tmartsum Thorbjørn Lund Martsum
            0 Vote for this issue
            3 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes