<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to Create a QTapAndHoldGesture &amp; Swipe Gesture  in Qt?]]></title><description><![CDATA[<p dir="auto">I am new to this qt- forum. This is My First Post. Happy to write here  :-)</p>
<p dir="auto">Can anyone please post  a simple working example for QTapAndHold Gesture and Swipe Gesture? I got very few examples from internet and tried with that.. None was working correct..</p>
]]></description><link>https://forum.qt.io/topic/31325/how-to-create-a-qtapandholdgesture-swipe-gesture-in-qt</link><generator>RSS for Node</generator><lastBuildDate>Sun, 18 Oct 2026 20:54:56 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/31325.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Aug 2013 09:17:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to Create a QTapAndHoldGesture &amp; Swipe Gesture  in Qt? on Mon, 31 Mar 2014 09:50:03 GMT]]></title><description><![CDATA[<p dir="auto">Hello Raagini,</p>
<p dir="auto">Is the solution provided by Rochi working for you ???  Actually this solution is not working for me. I am not able to recognize the QTapAndHold Gesture. I am using Qt 4.8 on Windows 7.</p>
<p dir="auto">Thanks in advance....</p>
]]></description><link>https://forum.qt.io/post/201264</link><guid isPermaLink="true">https://forum.qt.io/post/201264</guid><dc:creator><![CDATA[Himanshu Rohilla]]></dc:creator><pubDate>Mon, 31 Mar 2014 09:50:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to Create a QTapAndHoldGesture &amp; Swipe Gesture  in Qt? on Tue, 03 Sep 2013 10:56:08 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your replies.</p>
<p dir="auto">I have a another question regarding the same topic. Is it possible to grab a gesture for a Particular Component (say QPushButton).</p>
<p dir="auto">I have a <em>QPushButton</em>. For that  I have to grab the Gesture for it. But the Grab Gesture grabs for the whole widget and not for the particular component.</p>
<p dir="auto">Please give your suggestions about it.</p>
]]></description><link>https://forum.qt.io/post/193954</link><guid isPermaLink="true">https://forum.qt.io/post/193954</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 03 Sep 2013 10:56:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to Create a QTapAndHoldGesture &amp; Swipe Gesture  in Qt? on Thu, 29 Aug 2013 10:44:27 GMT]]></title><description><![CDATA[<p dir="auto">what do you have so far? what have you tried?<br />
Did you use QWidget::grabGesture()?</p>
]]></description><link>https://forum.qt.io/post/193158</link><guid isPermaLink="true">https://forum.qt.io/post/193158</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Thu, 29 Aug 2013 10:44:27 GMT</pubDate></item><item><title><![CDATA[Reply to How to Create a QTapAndHoldGesture &amp; Swipe Gesture  in Qt? on Thu, 29 Aug 2013 10:42:55 GMT]]></title><description><![CDATA[<p dir="auto">Welcome to Qt Forum! Hope this helps you to grab the Tap and Hold Gesture...</p>
<p dir="auto">@#include "MainWindow.h"<br />
#include "ui_MainWindow.h"<br />
#include &lt;QDebug&gt;<br />
#include &lt;QTapAndHoldGesture&gt;<br />
#include &lt;QGestureEvent&gt;</p>
<p dir="auto">MainWindow::MainWindow(QWidget *parent) :<br />
QMainWindow(parent),<br />
ui(new Ui::MainWindow)<br />
{<br />
ui-&gt;setupUi(this);<br />
grabGesture(Qt::TapAndHoldGesture);<br />
}</p>
<p dir="auto">MainWindow::~MainWindow()<br />
{<br />
delete ui;<br />
}</p>
<p dir="auto">bool MainWindow::event(QEvent *event)<br />
{<br />
if (event-&gt;type() == QEvent::Gesture)<br />
{<br />
QGestureEvent <em>gestevent = static_cast&lt;QGestureEvent</em>&gt;(event);<br />
if (QGesture *gest = gestevent-&gt;gesture(Qt::TapAndHoldGesture))<br />
{<br />
QTapAndHoldGesture *tapgest =  static_cast&lt;QTapAndHoldGesture *&gt;(gestevent-&gt;gesture(Qt::TapAndHoldGesture));<br />
qDebug() &lt;&lt; "Gesture position  is : " &lt;&lt; tapgest-&gt;position();<br />
}<br />
return true;<br />
}<br />
return QWidget::event(event);<br />
}@</p>
]]></description><link>https://forum.qt.io/post/193157</link><guid isPermaLink="true">https://forum.qt.io/post/193157</guid><dc:creator><![CDATA[Macro]]></dc:creator><pubDate>Thu, 29 Aug 2013 10:42:55 GMT</pubDate></item></channel></rss>