<?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[Weird behaviour with Qml (transparent background)]]></title><description><![CDATA[<p dir="auto">I am trying to achieve a transparent background in Qml for Win11 mica effect but for some reason the app starts with a white background and as i resize the window it becomes transparent what am i doing wrong ?</p>
<p dir="auto">Qml :</p>
<pre><code>import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Universal 2.12

import QtQml 2.12

ApplicationWindow {
    visible: true
    color: "transparent"
    width: 640
    height: 480

    Button {
        id: btn
        text: "Button"
        anchors.centerIn: parent
    }
}
</code></pre>
<p dir="auto">Win11 , Qt 6.8.3 , also happens on Qt6.9.3</p>
<p dir="auto">You can clone to reproduce,<br />
<a href="https://github.com/uncor3/qml-bug" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/uncor3/qml-bug</a></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/5406bc42-fe5f-4c0b-945d-8535508262cd.gif" alt="bug.gif" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/164583/weird-behaviour-with-qml-transparent-background</link><generator>RSS for Node</generator><lastBuildDate>Wed, 21 Oct 2026 07:22:23 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164583.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Apr 2026 14:17:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Weird behaviour with Qml (transparent background) on Tue, 21 Apr 2026 13:54:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/uncore">@<bdi>uncore</bdi></a> the actual problem is a false assumption. The black you see is not the transparent background after resize. It's just not rendered.</p>
<p dir="auto">I don't know if you can actually get a normal ApplicationWindow with only a transparent background.</p>
<p dir="auto">The Only way I know is via the QtFramelessWindowHint:</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/af646d06-9229-4099-8abb-975f44722759.png" alt="20d60691-52f3-4b4a-b1ed-591465ed7d0d-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">but that comes with missing menu bar and stuff</p>
]]></description><link>https://forum.qt.io/post/837913</link><guid isPermaLink="true">https://forum.qt.io/post/837913</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Tue, 21 Apr 2026 13:54:10 GMT</pubDate></item><item><title><![CDATA[Reply to Weird behaviour with Qml (transparent background) on Tue, 21 Apr 2026 13:11:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/j.hilk">@<bdi>J.Hilk</bdi></a> Didn't work. I actually tried forcing a rerender from both C++ and Qml side before but didn't work. Also this doesn't have anything to do with the Mica effect even i disable it the behavior is the same, starts with a white background then as i resize, it becomes transparent. Just tried with Qt 6.11.0 same result</p>
]]></description><link>https://forum.qt.io/post/837912</link><guid isPermaLink="true">https://forum.qt.io/post/837912</guid><dc:creator><![CDATA[uncore]]></dc:creator><pubDate>Tue, 21 Apr 2026 13:11:17 GMT</pubDate></item><item><title><![CDATA[Reply to Weird behaviour with Qml (transparent background) on Tue, 21 Apr 2026 05:45:26 GMT]]></title><description><![CDATA[<p dir="auto">Try the following:</p>
<pre><code>ApplicationWindow {
    id: rootWindowd
    visible: false
    color: "transparent"
    width: 640
    height: 480

    Component.onCompleted: rootWindowd.visible = true

    Button {
        id: btn
        text: "Button"
        anchors.centerIn: parent
    }
}
</code></pre>
<p dir="auto">that should force a redraw after everything is finished/initialized</p>
<p dir="auto">or</p>
<pre><code>function forceRedraw() {
        rootWindowd.contentItem.update()
    }
</code></pre>
<p dir="auto">If this works, than I would consider it a bug in the framework and you should open a bug report</p>
]]></description><link>https://forum.qt.io/post/837903</link><guid isPermaLink="true">https://forum.qt.io/post/837903</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Tue, 21 Apr 2026 05:45:26 GMT</pubDate></item><item><title><![CDATA[Reply to Weird behaviour with Qml (transparent background) on Mon, 20 Apr 2026 18:48:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kh-219design">@<bdi>KH-219Design</bdi></a> said in <a href="/post/837889">Weird behaviour with Qml (transparent background)</a>:</p>
<blockquote>
<pre><code>ApplicationWindow {


  flags: Qt.WA_TranslucentBackground
  color: "transparent"

</code></pre>
</blockquote>
<p dir="auto">"WA" is short for <a href="https://doc.qt.io/qt-6/qt.html#WidgetAttribute-enum" target="_blank" rel="noopener noreferrer nofollow ugc">WidgetAttribute</a>, while Window.flags is expecting a combination of <a href="https://doc.qt.io/qt-6/qt.html#WindowType-enum" target="_blank" rel="noopener noreferrer nofollow ugc">WindowFlags</a>.</p>
]]></description><link>https://forum.qt.io/post/837893</link><guid isPermaLink="true">https://forum.qt.io/post/837893</guid><dc:creator><![CDATA[jeremy_k]]></dc:creator><pubDate>Mon, 20 Apr 2026 18:48:22 GMT</pubDate></item><item><title><![CDATA[Reply to Weird behaviour with Qml (transparent background) on Mon, 20 Apr 2026 18:52:52 GMT]]></title><description><![CDATA[<p dir="auto">(At least in Qt 5, I think the following was needed. Not sure in Qt6)</p>
<p dir="auto"><s>Does it help if you try this <code>flags</code> setting</s>?</p>
<pre><code>ApplicationWindow {


  flags: Qt.WA_TranslucentBackground // or perhaps not. (see correction below)
  color: "transparent"

</code></pre>
<p dir="auto">UPDATE: whatever I was remembering or mis-rembering from Qt5 days, <a class="plugin-mentions-user plugin-mentions-a" href="/user/jeremy_k">@<bdi>jeremy_k</bdi></a> has pointed out that I must be mistaken (and I concur).</p>
<p dir="auto">(I didn't want to merely delete this comment, because when I come across "this post deleted" I always assume there was some weird spam initially, and that is not what this was!)</p>
]]></description><link>https://forum.qt.io/post/837889</link><guid isPermaLink="true">https://forum.qt.io/post/837889</guid><dc:creator><![CDATA[KH-219Design]]></dc:creator><pubDate>Mon, 20 Apr 2026 18:52:52 GMT</pubDate></item></channel></rss>