[SailfishDevel] Swipe Lock
Mariano Boragno
marianoboragno at gmail.com
Fri Nov 29 19:42:31 UTC 2013
Hi guys,
Anyway, this didn't work. I've set the Qt::WindowOverridesSystemGestures as
Jonni proposed but I can still minimize and close the application using the
swipe gesture.
This feature is a must in my application. The game is intended to block
babies from playing around with the phone while getting them entertained,
so I need a way to block the gestures.
Any other suggestions?
Thank you!!!
Regards...
...Mariano Boragno...
On Fri, Nov 29, 2013 at 3:13 PM, Mariano Boragno
<marianoboragno at gmail.com>wrote:
> Hi Jonni,
>
>
> Does that mean that I cannot dynamically enable/disable swipe lock on the
> fly?
>
>
> Thanks for your answer!
>
>
> Regards...
>
>
>
> --
>
>
>
> ...Mariano Boragno...
>
>
>
> On 29/11/13 14:45 Jonni Rainisto wrote:
> Hi
>
> You need to call that before your setSource-line, as setFlags will not do
> anything if qml is already loaded.
>
> Usually I do it with something like this:
> QScopedPointer<QGuiApplication> app(Sailfish::createApplication(
> argc, argv));
> QScopedPointer<QQuickView> view(Sailfish::createView());
>
> // Disable swipe gestures in proper way
>
> view->setFlags(view->flags()|Qt::WindowOverridesSystemGestures);
>
> Sailfish::setView(view.data(), "qrc:/main.qml");
>
>
> re, Jonni
> ------------------------------
> *From:* devel-bounces at lists.sailfishos.org [
> devel-bounces at lists.sailfishos.org] on behalf of Mariano Boragno [
> marianoboragno at gmail.com]
> *Sent:* Friday, November 29, 2013 6:54 PM
> *To:* devel at lists.sailfishos.org
> *Subject:* [SailfishDevel] Swipe Lock
>
> Hi guys,
>
> I'm doing a game that requires to lock the system gestures (it's a game
> for babies, so I have to lock the swipe to avoid the baby from surfing all
> around the phone :) )
>
> According to https://sailfishos.org/wiki/Porting/Harmattan it must be
> done through Qt::WindowOverridesSystemGestures, which I guess must be set
> on the main window. What I've done is:
>
> QGuiApplication *app = SailfishApp::application(argc, argv);
> QQuickView *view = SailfishApp::createView();
> view->setSource(SailfishApp::pathTo("qml/myGame.qml"));
> view->showFullScreen();
>
> view->setFlags(view->flags() | Qt::WindowOverridesSystemGestures);
>
> return app->exec();
>
> But I can still swipe the app away in the emulator.
>
> What am I doing wrong?
>
> Thanks a lot, regards...
>
>
> ...Mariano Boragno...
>
> _______________________________________________
> SailfishOS.org Devel mailing list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131129/18ad1f95/attachment.html>
More information about the Devel
mailing list