<?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[Purpose of FocusScope]]></title><description><![CDATA[<p dir="auto">Hello forum,</p>
<p dir="auto">I am trying ton understand the purpose of the Item FocusScope and following the documentation at</p>
<p dir="auto"><a href="http://doc.qt.io/qt-5/qtquick-input-focus.html" target="_blank" rel="noopener noreferrer nofollow ugc">FocusScope</a></p>
<p dir="auto">Could you please run the following snippet at your end?</p>
<pre><code>import QtQuick 2.0


	Rectangle
	{
		id: widget
		color: "lightsteelblue"
		width: 240
		height: 25
		radius: 10
		antialiasing: true

		Text { id: label; anchors.centerIn: parent }
		focus: true

		Keys.onPressed:
		{
			if(event.key == Qt.Key_A)
                           label.text = 'Key A was pressed'
			else if(event.key == Qt.Key_B)
			   label.text = 'Key B was pressed'
			else if(event.key == Qt.Key_C)
		           label.text = 'Key C was pressed'
		}		
	}	

</code></pre>
<pre><code>import QtQuick 2.0


Rectangle
{
	id: window
	color: "white"
	width: 240
	height: 150


	Column
	{
		anchors.centerIn: parent
		spacing: 15

		MyWidget
		{
			focus: true
			color: "lightblue"
		}

		MyWidget
		{
			color: "palegreen"
		}
	}
}
</code></pre>
<p dir="auto">The code works as expected without the usage of FocusScope. I am lost here.</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/topic/70160/purpose-of-focusscope</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 13:39:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/70160.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Aug 2016 21:29:02 GMT</pubDate><ttl>60</ttl></channel></rss>