I would like to use two widgets (one at a time) as the basis/background of my application, with a QML UI on top of it and a borderless window. It should look like this:
- An OpenGL-based scanning component
- A 3D visualization component operating via window handle
- Several QML UI components as overlays (possibly draggable)
- QML sidebar component
I have successfully achieved to include component 1 into a QGLWidget and have the QML components displayed on top of it. Worked without a problem.
However, I fail to make component 2 work. I can do it easily if I include it into a top-level QWidget and use its winId to access the handle. Unfortunately, I cannot build on top of that. I went through several options, but none of them seems to suffice:
- If I go the QWidget way, the component is on top and QML components cannot overlay.
- I tried to make it work with a QGraphicsProxyWidget, but it just displays an empty gray widget.
- I read that the new(er) way is to use a QWidget-based application and use QtQuick2 for overlays. But again, it only seems to work for OpenGL-based components.
- There is maybe also the option to use QQuickWidget and QOpenGLWidget, available in Qt 5.3 and 5.4, but I have no clue how and if it works as I have seen no examples that would fit my purpose.
- There would also be the option of
QWidget::createWindowContainer, but it does not allow (transparent) overlays.
My problem is that I don't know how to overlay a non-GL widget with QML and then later how to include everything into one application (possible parent problems with setViewport when switching between the two widgets). Has anyone ever done this or can point in a direction which might show results?
I am using Qt 5.2.1, VS2012 and build for x64 (requirement), targeting Windows desktop.
It would of course be good to have a performant solution, maybe based on QtQuick2, but I am at such a loss that I would accept anything that at least would make it work for the moment.

QQuickRenderControlclass - it allows to render QtQuick in an offscreen buffer which you can use as a texture to put wherever you want. - dtech