How to drag a QQuickView Object that is child of other QQuickview Object
Hello, i have written a mini program and i'm trying to drag a QQuickView Object that is child of other QQuickview Object.
This is my code:
int main(int argc, char *argv)
QApplication app(argc, argv);
QQuickView *dash= new QQuickView; dash->setSource(QUrl("qrc:/ui1.qml")); dash->show(); QQuickView *widget= new QQuickView; widget->setParent(dash); widget->setSource(QUrl("qrc:/widget.qml")); widget->show(); return app.exec();
and this is the result
The qmls files are rectangles only. The green rectangle is the Object that i want to drag, the "widget" Object
Any reason you want to use QQuickView's ? It would be lot easier if you use one QQuickView to load the QML file and in that QML file you can load components from the other QML files.