<?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[Transfer focus to SwipeView inner element]]></title><description><![CDATA[<p dir="auto">Hi all. What i am trying to achieve: I have custom QML component <code>CustomElem</code> with SwipeView inside. SwipeView by itself can contain different components inside and i want to transfer focus to one of them when <code>CustomElem</code> component take focus.</p>
<p dir="auto">For example:<br />
<code>main.qml</code> loaded --&gt; user push button and one of <code>CustomElem</code> in <code>main.qml</code> becomes focused (<code>elem.focus = true</code>) --&gt; focus is transferred through object hierarchy inside <code>CustomElem</code>, through SwipeView down to element inside the SwipeView, that have property <code>focus: true</code>.</p>
<p dir="auto">In my example i want that inner <code>Rectangle</code> <code>activeFocus</code> property becomes <code>true</code>.</p>
<p dir="auto">I have QML component <code>CustomElem.qml</code> with following code:</p>
<pre><code>import QtQuick 2.0
import QtQuick.Controls 2.2

Item {
    id: rootItem
    objectName: "rootItem"
    width: parent.width
    height: parent.height

    SwipeView {
        anchors.fill: parent
        objectName: "swipeView"

        Rectangle {
            id: innerRect
            objectName: "rectInRect"
            focus: true
            color: activeFocus ? "orange" : "black"
        }
    }
}
</code></pre>
<p dir="auto">This component used in <code>main.qml</code> as followed:</p>
<pre><code>import QtQuick 2.9
import QtQuick.Window 2.2

Window {
    objectName: "window"
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Item {
        id: keyHandler
        objectName: "keyHandler"
    }

    CustomElem {
        width: 200
        height: 200
        focus: true
    }

    CustomElem {
        width: 200
        height: 200
        y: 200
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/92110/transfer-focus-to-swipeview-inner-element</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Nov 2026 07:01:49 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/92110.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Jun 2018 13:25:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Transfer focus to SwipeView inner element on Tue, 07 Aug 2018 08:24:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/poor_robert">@<bdi>poor_robert</bdi></a> Hi! I used <code>KeyNavigation.down: swipe.currentItem</code> in the element root <code>Item</code>. But i think it is the same as <code>forceActiveFocus</code>.</p>
]]></description><link>https://forum.qt.io/post/474390</link><guid isPermaLink="true">https://forum.qt.io/post/474390</guid><dc:creator><![CDATA[egor.utsov]]></dc:creator><pubDate>Tue, 07 Aug 2018 08:24:23 GMT</pubDate></item><item><title><![CDATA[Reply to Transfer focus to SwipeView inner element on Mon, 06 Aug 2018 05:25:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/egor.utsov">@<bdi>egor.utsov</bdi></a><br />
Maybe this post would help?<br />
<a href="https://forum.qt.io/topic/93347/focus-issue-in-swipeview-with-loader">https://forum.qt.io/topic/93347/focus-issue-in-swipeview-with-loader</a></p>
]]></description><link>https://forum.qt.io/post/474121</link><guid isPermaLink="true">https://forum.qt.io/post/474121</guid><dc:creator><![CDATA[Diracsbracket]]></dc:creator><pubDate>Mon, 06 Aug 2018 05:25:31 GMT</pubDate></item><item><title><![CDATA[Reply to Transfer focus to SwipeView inner element on Sat, 04 Aug 2018 12:37:41 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I have very similar problem. Did you find any solution?</p>
<p dir="auto">poor_robert</p>
]]></description><link>https://forum.qt.io/post/473920</link><guid isPermaLink="true">https://forum.qt.io/post/473920</guid><dc:creator><![CDATA[poor_robert]]></dc:creator><pubDate>Sat, 04 Aug 2018 12:37:41 GMT</pubDate></item></channel></rss>