<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">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 style=" color:#000000;"><</span><span style=" color:#800080;">QGuiApplication</span><span style=" color:#000000;">></span><span style=" color:#c0c0c0;">
</span><span style=" color:#000000;">app</span><span style=" color:#000000;">(</span><span style=" color:#800080;">Sailfish</span><span style=" color:#000000;">::</span><span style=" color:#000000;">createApplication</span><span style=" color:#000000;">(</span><span style=" color:#000000;">argc</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;">
</span><span style=" color:#000000;">argv</span><span style=" color:#000000;">));</span><br>
<span style=" color:#c0c0c0;"></span><span style=" color:#800080;">        QScopedPointer</span><span style=" color:#000000;"><</span><span style=" color:#800080;">QQuickView</span><span style=" color:#000000;">></span><span style=" color:#c0c0c0;">
</span><span style=" color:#000000;">view</span><span style=" color:#000000;">(</span><span style=" color:#800080;">Sailfish</span><span style=" color:#000000;">::</span><span style=" color:#000000;">createView</span><span style=" color:#000000;">());</span><br>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; 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; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">view</span><span style=" color:#000000;">-></span><span style=" color:#000000;">setFlags</span><span style=" color:#000000;">(</span><span style=" color:#000000;">view</span><span style=" color:#000000;">-></span><span style=" color:#000000;">flags</span><span style=" color:#000000;">()|</span><span style=" color:#800080;">Qt</span><span style=" color:#000000;">::</span><span style=" color:#800080;">WindowOverridesSystemGestures</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800080;">Sailfish</span><span style=" color:#000000;">::</span><span style=" color:#000000;">setView</span><span style=" color:#000000;">(</span><span style=" color:#000000;">view</span><span style=" color:#000000;">.</span><span style=" color:#000000;">data</span><span style=" color:#000000;">(),</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">"qrc:/main.qml"</span><span style=" color:#000000;">);</span></pre>
<pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre>
re, Jonni<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF350285"><font color="#000000" face="Tahoma" size="2"><b>From:</b> devel-bounces@lists.sailfishos.org [devel-bounces@lists.sailfishos.org] on behalf of Mariano Boragno [marianoboragno@gmail.com]<br>
<b>Sent:</b> Friday, November 29, 2013 6:54 PM<br>
<b>To:</b> devel@lists.sailfishos.org<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>
</body>
</html>