<div dir="ltr"><div><div>Hi guys,<br><br>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.<br><br>
</div><div>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.<br></div><div><br></div>Any other suggestions?<br>
</div><div><br></div>Thank you!!!<br><br>Regards...<br><br></div><div class="gmail_extra"><br clear="all"><div>...Mariano Boragno...</div>
<br><br><div class="gmail_quote">On Fri, Nov 29, 2013 at 3:13 PM, Mariano Boragno <span dir="ltr"><<a href="mailto:marianoboragno@gmail.com" target="_blank">marianoboragno@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Hi Jonni,</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Does that mean that I cannot dynamically enable/disable swipe lock on the fly?</span></p>


<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Thanks for your answer!</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Regards... </span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'"> </span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">--</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'"> </span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">...Mariano Boragno...</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'"> </span></p></div><div><div class="h5"><br><div><p>On 29/11/13 14:45 Jonni Rainisto wrote:<br>

</p></div></div></div><div><div><div class="h5"><div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Hi<br>
<br>
You need to call that before your setSource-line, as setFlags will not do anything if qml is already loaded.<br>
<br>
Usually I do it with something like this:<br>
<span style="color:#c0c0c0"></span><span style="color:#800080">        QScopedPointer</span><span><</span><span style="color:#800080">QGuiApplication</span><span>></span><span style="color:#c0c0c0">
</span><span>app</span><span>(</span><span style="color:#800080">Sailfish</span><span>::</span><span>createApplication</span><span>(</span><span>argc</span><span>,</span><span style="color:#c0c0c0">
</span><span>argv</span><span>));</span><br>
<span style="color:#c0c0c0"></span><span style="color:#800080">        QScopedPointer</span><span><</span><span style="color:#800080">QQuickView</span><span>></span><span style="color:#c0c0c0">
</span><span>view</span><span>(</span><span style="color:#800080">Sailfish</span><span>::</span><span>createView</span><span>());</span><br>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#008000">//</span><span style="color:#c0c0c0"> </span><span style="color:#008000">Disable</span><span style="color:#c0c0c0"> </span><span style="color:#008000">swipe</span><span style="color:#c0c0c0"> </span><span style="color:#008000">gestures</span><span style="color:#c0c0c0"> </span><span style="color:#008000">in</span><span style="color:#c0c0c0"> </span><span style="color:#008000">proper</span><span style="color:#c0c0c0"> </span><span style="color:#008000">way</span></pre>


<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span>view</span><span>-></span><span>setFlags</span><span>(</span><span>view</span><span>-></span><span>flags</span><span>()|</span><span style="color:#800080">Qt</span><span>::</span><span style="color:#800080">WindowOverridesSystemGestures</span><span>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#800080">Sailfish</span><span>::</span><span>setView</span><span>(</span><span>view</span><span>.</span><span>data</span><span>(),</span><span style="color:#c0c0c0"> </span><span style="color:#008000">"qrc:/main.qml"</span><span>);</span></pre>


<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br></pre>
re, Jonni<br>
<div style="font-size:16px;font-family:Times New Roman">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> <a href="mailto:devel-bounces@lists.sailfishos.org" target="_blank">devel-bounces@lists.sailfishos.org</a> [<a href="mailto:devel-bounces@lists.sailfishos.org" target="_blank">devel-bounces@lists.sailfishos.org</a>] on behalf of Mariano Boragno [<a href="mailto:marianoboragno@gmail.com" target="_blank">marianoboragno@gmail.com</a>]<br>


<b>Sent:</b> Friday, November 29, 2013 6:54 PM<br>
<b>To:</b> <a href="mailto:devel@lists.sailfishos.org" target="_blank">devel@lists.sailfishos.org</a><br>
<b>Subject:</b> [SailfishDevel] Swipe Lock<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>
<div>Hi guys,<br>
<br>
</div>
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 :) )<br>
<br>
</div>
According to <a href="https://sailfishos.org/wiki/Porting/Harmattan" target="_blank">
https://sailfishos.org/wiki/Porting/Harmattan</a> it must be done through Qt::WindowOverridesSystemGestures, which I guess must be set on the main window. What I've done is:<br>
<br>
    QGuiApplication *app = SailfishApp::application(argc, argv);<br>
    QQuickView *view = SailfishApp::createView();<br>
<div>
<div>    view->setSource(SailfishApp::pathTo("qml/myGame.qml"));<br>
    view->showFullScreen();<br>
<br>
    view->setFlags(view->flags() | Qt::WindowOverridesSystemGestures);<br>
<br>
    return app->exec();<br>
<br>
</div>
<div>But I can still swipe the app away in the emulator.<br>
<br>
<div>What am I doing wrong?<br>
<br>
Thanks a lot, regards...<br>
<br>
</div>
<div><br clear="all">
<div>
<div>...Mariano Boragno...</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<br></div></div>_______________________________________________<br>
SailfishOS.org Devel mailing list<br></div><br></div>
</blockquote></div><br></div>