I have a requirement for my project to display two QML Windowon each of them (one sender, one receiver). Both of them .qmlrequire me to include some Cpp models inside, I use QQmlApplicationEngineCpp for registration of models.
I found out that with the help QWidget::createWindowContainer()I can display several Windowfor one project. This works great for the first QML file. The code snippets are as follows:
QQmlApplicationEngine* engine = new QQmlApplicationEngine(Qurl("main.qml"));
QmlContext* context = engine.getContextProperty();
QQuickview *view = new QQuickview(engine,0);
QWidget* container = widget::createWindowContainer(view);
I decided to create a second application engine for mine receive.qmlusing a similar method. I soon realized that it receive.qmlwould never open even with container2->show(). Now it shows a blank page.
My questions:
- Is my approach right or is there a better solution for this?
- ,
? , ,
. ,
.