<?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 Quick SafeArea not working correctly on Android]]></title><description><![CDATA[<p dir="auto"><strong>Issue:</strong> On Android, SafeArea.margins seems to return zero, so the safe area fills the entire screen.</p>
<p dir="auto">I am trying to create a Qt Quick mobile application using SafeArea to restrict the location of contents on the screen. It works well on desktop, but when I run it on my mobile device the margins provided by SafeArea either don't work, or return zero.</p>
<p dir="auto">I have created an MWE using Qt 6.9.1 to demonstrate the problem. This MWE is based on the example provided in the <a href="https://doc.qt.io/qt-6//qml-qtquick-safearea.html" target="_blank" rel="noopener noreferrer nofollow ugc">SafeArea</a> documentation. The full window is filled with the SunnyMorning (orange) gradient, while the safe area of the window is filled with the DustyGrass (green) gradient.</p>
<pre><code>import QtQuick
import QtQuick.Controls

ApplicationWindow {
    width: 640
    height: 480
    visible: true
    flags: Qt.Window | Qt.ExpandedClientAreaHint | Qt.NoTitleBarBackgroundHint
    title: qsTr("Safe Area")
    topPadding: 0


    Rectangle {
        id: parentItem
        gradient: Gradient.SunnyMorning
        anchors.fill: parent

        Rectangle {
            id: childItem
            gradient: Gradient.DustyGrass

            anchors {
                fill: parent

                topMargin: parent.SafeArea.margins.top
                leftMargin: parent.SafeArea.margins.left
                rightMargin: parent.SafeArea.margins.right
                bottomMargin: parent.SafeArea.margins.bottom
            }
        }
    }
}
</code></pre>
<p dir="auto">However, when running the application the safe area (DustyGrass) erroneously fills up the entire window and no SunnyMorning gradient is visible. The safe area should not overlap the status bar at the top, nor the controls at the bottom. Those areas should show the SunnyMorning gradient.</p>
<p dir="auto"><strong>Question:</strong> How can I ensure that SafeArea behaves correctly on Android devices, respecting the status and navigation bars?</p>
<p dir="auto"><strong>Note:</strong> I would have like to include images showing the problem, but they keep getting flagged as spam. To see the application output on desktop and mobile take a look at <a href="https://stackoverflow.com/questions/79775953/qt-quick-qml-safearea-not-working-on-android-devices" target="_blank" rel="noopener noreferrer nofollow ugc">this post</a>.</p>
<p dir="auto">Android build info (possibly relevant):</p>
<ul>
<li>DANDROID_ABI: arm64-v8a</li>
<li>DANDROID_NDK: 27.2.12479018</li>
<li>DANDROID_PLATFORM: android-23</li>
<li>Build-tools: 35.0.1</li>
<li>SDK: android-35</li>
</ul>
]]></description><link>https://forum.qt.io/topic/163350/qt-quick-safearea-not-working-correctly-on-android</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 08:00:05 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163350.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Sep 2025 13:18:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt Quick SafeArea not working correctly on Android on Mon, 04 May 2026 07:30:32 GMT]]></title><description><![CDATA[<p dir="auto">for me it's working on Android and iOS with Qt 6.10.1+<br />
see also my test app: <a href="https://github.com/ekke/ekkesTestStatusBar" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/ekke/ekkesTestStatusBar</a></p>
]]></description><link>https://forum.qt.io/post/838099</link><guid isPermaLink="true">https://forum.qt.io/post/838099</guid><dc:creator><![CDATA[ekkescorner]]></dc:creator><pubDate>Mon, 04 May 2026 07:30:32 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Quick SafeArea not working correctly on Android on Mon, 04 May 2026 07:11:54 GMT]]></title><description><![CDATA[<p dir="auto">Qt Quick SafeArea should be working now? Except on 6.8 there is more to come <a href="https://qt-project.atlassian.net/browse/QTBUG-140193" target="_blank" rel="noopener noreferrer nofollow ugc">https://qt-project.atlassian.net/browse/QTBUG-140193</a></p>
]]></description><link>https://forum.qt.io/post/838098</link><guid isPermaLink="true">https://forum.qt.io/post/838098</guid><dc:creator><![CDATA[Rampe]]></dc:creator><pubDate>Mon, 04 May 2026 07:11:54 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Quick SafeArea not working correctly on Android on Fri, 26 Sep 2025 15:27:11 GMT]]></title><description><![CDATA[<p dir="auto">6.9.3 will come out next week <a href="https://wiki.qt.io/Qt_6.9_Release" target="_blank" rel="noopener noreferrer nofollow ugc">https://wiki.qt.io/Qt_6.9_Release</a></p>
]]></description><link>https://forum.qt.io/post/832063</link><guid isPermaLink="true">https://forum.qt.io/post/832063</guid><dc:creator><![CDATA[ekkescorner]]></dc:creator><pubDate>Fri, 26 Sep 2025 15:27:11 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Quick SafeArea not working correctly on Android on Fri, 26 Sep 2025 14:35:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekkescorner">@<bdi>ekkescorner</bdi></a> In Qt Maintenance Tool I do not see 6.9.3. The newest options available to me are 6.9.2 and 6.10.0-rc. Would 6.9.2 be sufficient? How could I get 6.9.3 in another way?</p>
]]></description><link>https://forum.qt.io/post/832061</link><guid isPermaLink="true">https://forum.qt.io/post/832061</guid><dc:creator><![CDATA[Dan_v]]></dc:creator><pubDate>Fri, 26 Sep 2025 14:35:48 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Quick SafeArea not working correctly on Android on Fri, 26 Sep 2025 13:55:49 GMT]]></title><description><![CDATA[<p dir="auto">you need Qt 6.9.3 with fixes to SafeArea on Android<br />
<a href="https://bugreports.qt.io/browse/QTBUG-135808" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-135808</a><br />
<a href="https://bugreports.qt.io/browse/QTBUG-139690" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-139690</a><br />
BTW: the problem with SafeArea is 0 at startup on Android: workaround rotate to landscape and back. but this is fixed w 6.9.3</p>
]]></description><link>https://forum.qt.io/post/832055</link><guid isPermaLink="true">https://forum.qt.io/post/832055</guid><dc:creator><![CDATA[ekkescorner]]></dc:creator><pubDate>Fri, 26 Sep 2025 13:55:49 GMT</pubDate></item></channel></rss>