<?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 adapt the touchscreen to a rotated application?]]></title><description><![CDATA[<p dir="auto">I'm implementing a Qt application on an embedded platform. The application relies on the eglfs platform plugin and uses as input a touch screen.</p>
<p dir="auto">The application is shown on screen with a counter clockwise rotation of -90°. The rotation is performed at GPU level, using a virtual frame buffer.</p>
<p dir="auto">How to adapt the touchscreen to the rotated app? Is it possible to perform the rotation of the touch points at application level? If yes, how?</p>
<p dir="auto">I've tried to set the QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS environment variable but without success. When the variable is set, e.g. "QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=rotate=270", the touch screen is no longer recognized.</p>
<p dir="auto">Thanks in advance for your time</p>
]]></description><link>https://forum.qt.io/topic/63461/how-to-adapt-the-touchscreen-to-a-rotated-application</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 15:34:07 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/63461.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Jan 2016 13:29:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to adapt the touchscreen to a rotated application? on Sat, 30 Jan 2016 10:52:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stan.m">@<bdi>stan.m</bdi></a> thank you very much for your time. Unfortunately the solution you have proposed is not suitable for my needs. The rotation must be performed at GPU level, it's not possible to make it at application level.</p>
<p dir="auto">The question remains unaswered</p>
]]></description><link>https://forum.qt.io/post/310531</link><guid isPermaLink="true">https://forum.qt.io/post/310531</guid><dc:creator><![CDATA[Grynium]]></dc:creator><pubDate>Sat, 30 Jan 2016 10:52:04 GMT</pubDate></item><item><title><![CDATA[Reply to How to adapt the touchscreen to a rotated application? on Thu, 28 Jan 2016 22:47:21 GMT]]></title><description><![CDATA[<p dir="auto">Don't do it that way -- a royal pain in the arse regarding touch input.</p>
<p dir="auto">To solve your problem in QML, move all your content into a top-level Item, center and rotate it. This will rotate all the Item's children: MouseArea's, Text components, etc..</p>
<p dir="auto">Here is a component that rotates a QML UI:</p>
<pre><code>// ScreenRotator.qml -- rotates contents when isRotated set true

import QtQuick 2.0

Item {
    property bool isRotated: true

    anchors.centerIn: parent
    rotation: isRotated ? -90 : 0
    width: isRotated ? parent.height : parent.width
    height: isRotated ? parent.width : parent.height
    Component.onCompleted: if (isRotated) showFullScreen()
}
</code></pre>
<p dir="auto">Here is an example of usage:</p>
<pre><code>// Demonstrates ScreenRotator component, rotating display 90 degrees

import QtQuick 2.5
import QtQuick.Window 2.2

Window {
    width: 320; height: 240
    visible: true

    ScreenRotator {
        id: screenRotator

        isRotated: (Screen.width == 800)  // Target has 800x600 display

        Rectangle {  // Background changes color when click misses 'Quit' box
            anchors.fill: parent
            color: mouseArea.pressed ? 'orangered' : 'white'

            MouseArea { id: mouseArea; anchors.fill: parent }
        }
        Text {  // Show the type of current platform and window dimensions
            anchors.centerIn: parent
            horizontalAlignment: Text.AlignHCenter
            text: '%1\n(%2x%3)'
                  .arg((screenRotator.isRotated
                        ? qsTr('Embedded')
                        : qsTr('Workstation')))
                  .arg(parent.width)
                  .arg(parent.height)
        }
        Rectangle {
            anchors { right: parent.right; bottom: parent.bottom }
            width: label.width + label.height; height: 1.5*label.height
            color: 'brown'

            Text { id: label; text: qsTr('Quit'); color: 'white'; anchors.centerIn: parent }
            MouseArea { anchors.fill: parent; onClicked: Qt.quit() }
        }
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/310148</link><guid isPermaLink="true">https://forum.qt.io/post/310148</guid><dc:creator><![CDATA[stan.m]]></dc:creator><pubDate>Thu, 28 Jan 2016 22:47:21 GMT</pubDate></item></channel></rss>