Create QtQuick application from External Win32 window
-
I've not tried it but I believe getting a QWindow by using
QWindow::fromWinId
and 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::objectCreated
signal and callsetParent
on 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
QQuickView
instead ofQQmlApplicationEngine
and callsetParent
on it.
- get the window you created from QML with
-
I've not tried it but I believe getting a QWindow by using
QWindow::fromWinId
and 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::objectCreated
signal and callsetParent
on 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
QQuickView
instead ofQQmlApplicationEngine
and callsetParent
on it.
- get the window you created from QML with