Thanks, I did try createWindowContainer and it works fine but I was expecting that QQuickWidget would work too given that it's recommended before createWindowContainer. Also it seems like the same problem happens when using QOffscreenSurface with QQuickRenderControl for the same qml with canvas3d.
After further testing with the QQmlEngine::addImportPaths(), QQmlEngine::addPluginPaths(), QQmlEngine::setImportPathList() and QQmlEngine::setPluginPathList() functions none of these allowed the QtQuick and QtQuick.Controls qml modules to be found and installed.
I then added the QML2_IMPORT_PATH environment variable and set it to point to my Qt build qml folder D:/qt-5.5.1_vs2012x64/qt_build/qtbase/qml and this worked.
Question is why don't the paths added by the QQmlEngine functions work? The paths are added but don't seem to be searched.
I'm having the exact same problem on Android. When I drag a QQuickWidget that is hosting a QML-based WebView on Android, the widget moves but the WebView is left in the original position. Wondering if there has been any progress or a workaround for this issue.
I am using Qt 5.10.0, developing for an x86 Android platform.
@xumuk As said earlier it is a limitation. But if you still need it you should have a look at the 2nd and 3rd paragraph in the link which I posted earlier. Basically you will have to do this:
QQuickWidget *wd = new QQuickWidget(this);
//and the opacity can be set in QML istelf for eg. for a Rectangle
If you load this QML in the QQuickWIdget and put a QWidget in background it should be visible.
@p3c0 This isn't what i'm trying to do. Setting the whole item as the drag.target would make the item follow the cursor and since the item can't be drawn outside of the Qml scene it would clip as soon as the pointer leaves the dock. I use a non visual "draggable" Item to be the drag.target like in the externaldraganddrop example.
I tried what you suggested and noticed something strange however.
Inside a QQuickWidget : the item will not follow the cursor during the drag and drop but follow it after the user releases the mouse button ("locking" the mouse in the process). MouseArea.onReleased is not called after the drag and drop.
Inside a full Qml application : the item will not follow the cursor during the drag and drop but move to the cursor when the user releases the mouse button. MouseArea.onReleased is called after the drag and drop.