<?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[Qt Touch Event Handling Issue: Positional Offset and Poor Finger Response on Resistive Screen]]></title><description><![CDATA[<p dir="auto">Hello Qt Community,</p>
<p dir="auto">I am currently working on an embedded project using the Allwinner A133 processor with the following configuration:</p>
<p dir="auto">Operating System: Ubuntu 18.04<br />
Kernel: Linux 4.9<br />
Qt Version: Qt 5.12.12 (Qt Widgets)<br />
Touch Type: Resistive touchscreen</p>
<p dir="auto">For touch detection, I am using the following implementation:<br />
void MainWindow::enableTouchOnAllWidgets(QWidget *widget)<br />
{<br />
if (!widget) return;<br />
widget-&gt;setAttribute(Qt::WA_AcceptTouchEvents);<br />
foreach (QWidget <em>child, widget-&gt;findChildren&lt;QWidget</em>&gt;()) {<br />
child-&gt;setAttribute(Qt::WA_AcceptTouchEvents);<br />
}<br />
}</p>
<p dir="auto">bool MainWindow::event(QEvent *event)<br />
{<br />
if (event-&gt;type() == QEvent::TouchBegin ||<br />
event-&gt;type() == QEvent::TouchUpdate ||<br />
event-&gt;type() == QEvent::TouchEnd)<br />
{<br />
QTouchEvent <em>touchEvent = static_cast&lt;QTouchEvent</em>&gt;(event);<br />
if (touchEvent-&gt;touchPoints().isEmpty()) {<br />
event-&gt;accept();<br />
return true;<br />
}</p>
<pre><code>    if (event-&gt;type() == QEvent::TouchBegin)
    {
        touchProcessing = false;
    }

    if (event-&gt;type() == QEvent::TouchEnd)
    {
        if (touchProcessing)
        {
            event-&gt;accept();
            return true;
        }

        QPoint globalPos = touchEvent-&gt;touchPoints().first().screenPos().toPoint();

        QWidget *widget = QApplication::widgetAt(globalPos);

        if (widget)
        {
            QWidget *current = widget;
            while (current)
            {
                QPushButton *button = qobject_cast&lt;QPushButton*&gt;(current);
                if (button &amp;&amp; button-&gt;isEnabled() &amp;&amp; button-&gt;isVisible())
                {
                    touchProcessing = true;
                    emit button-&gt;clicked();
                    event-&gt;accept();
                    return true;
                }
                current = current-&gt;parentWidget();
            }

            QPoint targetPos = widget-&gt;mapFromGlobal(globalPos);

            QMouseEvent press(QEvent::MouseButtonPress,
                targetPos,
                Qt::LeftButton,
                Qt::LeftButton,
                Qt::NoModifier);
            QApplication::sendEvent(widget, &amp;press);

            QMouseEvent release(QEvent::MouseButtonRelease,
                targetPos,
                Qt::LeftButton,
                Qt::LeftButton,
                Qt::NoModifier);
            QApplication::sendEvent(widget, &amp;release);

            touchProcessing = true;
        }
    }

    event-&gt;accept();
    return true;
}

return QWidget::event(event);
</code></pre>
<p dir="auto">}<br />
However, I am experiencing a positional offset issue with the touch input. For buttons located at the bottom of the display, the touch response is shifted approximately 1 cm downward—meaning the button only responds when I touch about 1 cm below its actual position. Similarly, for buttons on the right side, the touch response is shifted approximately 1 cm to the right. The same behavior is observed for other directions as well.</p>
<p dir="auto">Additionally, I am facing another issue with the resistive touchscreen: touch input using a fingernail is detected accurately, but touch input using a finger is inconsistent or unreliable.</p>
<p dir="auto">Could you please help me understand the possible causes of these issues and suggest solutions to resolve them?</p>
<p dir="auto">Thank you.</p>
]]></description><link>https://forum.qt.io/topic/164483/qt-touch-event-handling-issue-positional-offset-and-poor-finger-response-on-resistive-screen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 15:35:15 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164483.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Mar 2026 05:53:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt Touch Event Handling Issue: Positional Offset and Poor Finger Response on Resistive Screen on Wed, 25 Mar 2026 13:25:44 GMT]]></title><description><![CDATA[<p dir="auto">I did ts_calibrate many times and in ts_test also working only</p>
]]></description><link>https://forum.qt.io/post/837323</link><guid isPermaLink="true">https://forum.qt.io/post/837323</guid><dc:creator><![CDATA[Ramanujum]]></dc:creator><pubDate>Wed, 25 Mar 2026 13:25:44 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Touch Event Handling Issue: Positional Offset and Poor Finger Response on Resistive Screen on Wed, 25 Mar 2026 11:00:39 GMT]]></title><description><![CDATA[<p dir="auto">You have to calibrate the screen?! I think.</p>
]]></description><link>https://forum.qt.io/post/837317</link><guid isPermaLink="true">https://forum.qt.io/post/837317</guid><dc:creator><![CDATA[sbela]]></dc:creator><pubDate>Wed, 25 Mar 2026 11:00:39 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Touch Event Handling Issue: Positional Offset and Poor Finger Response on Resistive Screen on Wed, 25 Mar 2026 10:27:28 GMT]]></title><description><![CDATA[<p dir="auto">Yes i got but not perfectly i got , i am getting my buttons in offset places</p>
]]></description><link>https://forum.qt.io/post/837316</link><guid isPermaLink="true">https://forum.qt.io/post/837316</guid><dc:creator><![CDATA[Ramanujum]]></dc:creator><pubDate>Wed, 25 Mar 2026 10:27:28 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Touch Event Handling Issue: Positional Offset and Poor Finger Response on Resistive Screen on Wed, 25 Mar 2026 10:13:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ramanujum">@<bdi>Ramanujum</bdi></a> Not sure I understand. You get touch events in your Qt app, right?</p>
]]></description><link>https://forum.qt.io/post/837315</link><guid isPermaLink="true">https://forum.qt.io/post/837315</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 25 Mar 2026 10:13:42 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Touch Event Handling Issue: Positional Offset and Poor Finger Response on Resistive Screen on Wed, 25 Mar 2026 08:07:36 GMT]]></title><description><![CDATA[<p dir="auto">In my case it is not working after this only  my qt ui is reacting for touch event and added #include&lt;QTouchEvent&gt;</p>
]]></description><link>https://forum.qt.io/post/837312</link><guid isPermaLink="true">https://forum.qt.io/post/837312</guid><dc:creator><![CDATA[Ramanujum]]></dc:creator><pubDate>Wed, 25 Mar 2026 08:07:36 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Touch Event Handling Issue: Positional Offset and Poor Finger Response on Resistive Screen on Wed, 25 Mar 2026 06:04:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ramanujum">@<bdi>Ramanujum</bdi></a> Why are you doing all this? QPushButton already supports touch events.</p>
]]></description><link>https://forum.qt.io/post/837310</link><guid isPermaLink="true">https://forum.qt.io/post/837310</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 25 Mar 2026 06:04:37 GMT</pubDate></item></channel></rss>