Do not loose the content when switching app

This commit is contained in:
Andrea Scarpino 2014-11-15 20:12:09 +01:00
parent ffdd7b19e2
commit accb8ff09d
3 changed files with 12 additions and 2 deletions

View file

@ -9,7 +9,7 @@ OTHER_FILES += \
qml/cover/CoverPage.qml \
translations/*.ts \
qml/pages/MainPage.qml \
qml/harbour-papocchio.qml \
qml/Papocchio.qml \
harbour-papocchio.desktop \
rpm/harbour-papocchio.changes \
rpm/harbour-papocchio.spec \

View file

@ -22,7 +22,17 @@
int main(int argc, char *argv[])
{
QGuiApplication *app = SailfishApp::application(argc, argv);
return SailfishApp::main(argc, argv);
// Otherwise the Canvas is cleaned when the application is not
// marked as active. See for more:
// https://lists.sailfishos.org/pipermail/devel/2014-October/005065.html
QQuickView *view = SailfishApp::createView();
view->setSource(SailfishApp::pathTo("qml/Papocchio.qml"));
view->setPersistentOpenGLContext(true);
view->setPersistentSceneGraph(true);
view->show();
return app->exec();
}