How can i start a global qml viewer or a child Form of my app?
-
Hi
"Picture":http://www.imgbox.de/show/img/0hG7WzqFOI.jpg
1 and 2 work but 3 doesnt work!
There are no exception and the window gets created for a short moment but than crashes.i hope you can help me
Ciao
-
thx
but how can i create a global viewer?
or how can i start a child Form from a qml file?
-
now i have a memory leak after closing? there shoudnt be a problem with this or?
-
thx
when i call the viewer i exit the class and go to the app event loop.
how can i delete this Viewer/Object when the destructor is called manually?
the leak occurse after closing the app
-
thx andre for your reply
but i dont get it.
when i have sth like this:
@Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/testleak/main.qml")); viewer.showExpanded(); QmlApplicationViewer viewer1; viewer1.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer1.setMainQmlFile(QLatin1String("qml/testleak/main.qml")); viewer1.showExpanded(); return app->exec();
}@
how can i realize this command viewer.hide
after i started the qml app
-
this produces the leak "view" gets never deleted
but more important would be how can I create more viewer after the app has started
@void init(QString qmlfile)
{
QmlApplicationViewer *view = new QmlApplicationViewer;
view->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
view->setSource(QUrl(qmlfile));
view->showExpanded();
return;
}Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));init("qml/testleak/main.qml"); QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/testleak/main.qml")); viewer.showExpanded(); viewer.show(); QmlApplicationViewer viewer1; viewer1.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer1.setMainQmlFile(QLatin1String("qml/testleak/main.qml")); viewer1.showExpanded(); return app->exec();
}@