<?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[QML - How to stop app from grabbing focus at startup]]></title><description><![CDATA[<p dir="auto">How can an QML app <strong>completely</strong> avoid grabbing focus at startup?</p>
<p dir="auto">I want to run an app with <em>qmlscene</em> which displays its window but does not grab focus.  In other words, keyboard and mouse stay focused on the (unrelated) window where they were before the app started (either by that other app, or a background activity).</p>
<p dir="auto">For example, to display a notifications without forcing the user to respond immediately.</p>
<p dir="auto">To get specific, how should the following be changed so that the Linux command</p>
<pre><code>qmlscene file.qml &amp;
</code></pre>
<p dir="auto">does not take focus away from the terminal?</p>
<pre><code>import QtQuick 2.12
import QtQuick.Controls 2.12

ApplicationWindow {
  visible:true
   
  Text{ text: "Take care of this later" }
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/99773/qml-how-to-stop-app-from-grabbing-focus-at-startup</link><generator>RSS for Node</generator><lastBuildDate>Sat, 09 May 2026 04:35:48 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/99773.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Feb 2019 22:25:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QML - How to stop app from grabbing focus at startup on Mon, 11 Mar 2019 02:37:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a>   flags works great, thanks.</p>
]]></description><link>https://forum.qt.io/post/516573</link><guid isPermaLink="true">https://forum.qt.io/post/516573</guid><dc:creator><![CDATA[jimav]]></dc:creator><pubDate>Mon, 11 Mar 2019 02:37:33 GMT</pubDate></item><item><title><![CDATA[Reply to QML - How to stop app from grabbing focus at startup on Mon, 18 Feb 2019 07:40:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jimav">@<bdi>jimav</bdi></a><br />
untested, but try the following:</p>
<pre><code>ApplicationWindow {
    flags: Qt.Tool
    // or
   flags: Qt.Window | Qt.WindowDoesNotAcceptFocus
}
</code></pre>
<p dir="auto">Unfortunately the window flags are not supported the same on every platform.</p>
]]></description><link>https://forum.qt.io/post/512111</link><guid isPermaLink="true">https://forum.qt.io/post/512111</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Mon, 18 Feb 2019 07:40:55 GMT</pubDate></item></channel></rss>