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.