Create QtQuick application from External Win32 window
-
I've not tried it but I believe getting a QWindow by using
QWindow::fromWinIdand then using that as the parent window of the window you want to embed would work.That doesn't seem to be possible from QML straight away though, possible solutions are:
- get the window you created from QML with
QQmlApplicationEngine::objectCreatedsignal and callsetParenton it (only works if your window is the root component of your qml file). - create a C++ helper callable from QML, a attached type would be a good choice. usage in QML would be like so:
ParentWindow.parent: theWindowYouExposedFromC++ - use
QQuickViewinstead ofQQmlApplicationEngineand callsetParenton it.
- get the window you created from QML with
-
I've not tried it but I believe getting a QWindow by using
QWindow::fromWinIdand then using that as the parent window of the window you want to embed would work.That doesn't seem to be possible from QML straight away though, possible solutions are:
- get the window you created from QML with
QQmlApplicationEngine::objectCreatedsignal and callsetParenton it (only works if your window is the root component of your qml file). - create a C++ helper callable from QML, a attached type would be a good choice. usage in QML would be like so:
ParentWindow.parent: theWindowYouExposedFromC++ - use
QQuickViewinstead ofQQmlApplicationEngineand callsetParenton it.
- get the window you created from QML with