Any application that uses QWidget::createWindowContainer to embed GL or QML ends up with a chain of native child widgets going from the embedded window up to the root. This was originally done because:
- Solves clipping to parent items
- Solves positioning in the hierarchy
- Solves overlapping widgets
- Native child windows "already work"
However, native child widgets are very expensive to resize and redraw, and will most likely also cost us more in terms of memory as each widget potentially gets its own window surface. For instance, resizing the "designer" window in Qt Creator takes several hundred milliseconds because of the native child widgets.
Instead, we will attach the embedded window directly to the root window and don't use native child widgets at all. That keeps the rest of the app performant.
Certain things needs to be done:
- Document that overlapping widgets will not stack according to QWidget stacking.
- We need to make sure that dockwidget, MDI widgets and scroll areas still work with embedding. This can be done by using native child id's in these cases and document that they will perform a lot worse because of it.
- Extend the tests to include dock widgets, MDI widgets and scroll areas.
|For Gerrit Dashboard: QTBUG-34138|
|68683,5||Better QWindowContainer by not relying on native widgets.||stable||qt/qtbase||Status: MERGED||+2||0|
|68826,2||Remove setting of Qt::AA_DontCreateNativeWidgetSiblings .||3.0||qt-creator/qt-creator||Status: MERGED||+2||0|