Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.3, 5.12.5, 5.13.1, 5.15.5, 6.0.3, 6.1.2
-
-
51300566ffe2ece2455e1d0479a556c5dbb3bb8e (qt/qtbase/dev)
Description
A QWidget looses its visual representation after re-opening a window containing that Widget when this widget calls `winId()`
I tested this on windows (5.12.4, 5.12.5) and macos (5.11.3, 5.12.2, 5.12.5, 5.13.1). This problem does not appear in 5.9.8, this may occur on other platforms as well.
Versions between 5.9.8 and 5.11.3 were not tested.
I boiled this problem down to setting attribute `Qt::WA_NativeWindow` on the widget.
Setting this attribute causes this problem as well as calling `winId()` does, which might set this attribute as well.
As the code for `QWidget::winId()` and `QWidgetPrivate::createWinId()` of 5.9.8 and 5.12.5 is identical it must be related to other effects of this attribute.
Please see attached example and try:
1) run application and press button "Show"
2) a widget opens with a button "Button" inside
3) close the window
4) press button "Show" again
5) the widget shows empty
This problem does not occur, if one hides the widget with `QWidget::hide()`.
it seems these bugreports are related:
QTBUG-30181, QTBUG-57089
Attachments
Issue Links
- is duplicated by
-
QTBUG-96286 [Reg 5.9.8 -> ] QWidget loosing contents when using winId() and re-opened
-
- Closed
-
For Gerrit Dashboard: QTBUG-79012 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
372871,8 | Fix closing and showing a window with a native child | dev | qt/qtbase | Status: MERGED | +2 | 0 |