<?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[QComboBox cannot make dropdown window background transparent]]></title><description><![CDATA[<p dir="auto">I've tried everything I could to make the QComboBox window background transparent, but it just shows up black:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/b6f7585a-b14d-482d-a2c6-5f72ec3bd14f.png" alt="86df0d27-0c68-443d-b085-fc000d244cde-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I am using Qt 5.12.9 on Windows 10. The QComboBox's stylesheet is</p>
<pre><code>* {
    padding: 10px 10px 10px 10px;
    border-radius: 10px; 
}
</code></pre>
<p dir="auto">and in mainwindow.cpp in a brand new, empty Qt project (with just the combobox added and mainwindow background set to red for visibility):</p>
<pre><code>    ui-&gt;comboBox-&gt;setFrame(false);
    QFrame* window = dynamic_cast&lt;QFrame*&gt;(ui-&gt;comboBox-&gt;view()-&gt;window()); // this is a QComboBoxPrivateContainer, which is a subclass of QFrame
    window-&gt;setFrameStyle(QFrame::NoFrame);
    window-&gt;setStyleSheet("* { background-color: green; }");
    window-&gt;setWindowFlags(Qt::FramelessWindowHint);
    window-&gt;setAttribute(Qt::WA_TranslucentBackground, true);
    window-&gt;setAttribute(Qt::WA_OpaquePaintEvent, true);
</code></pre>
<p dir="auto">Yet the window background is still black. Further, FramelessWindowHint prevents the dropdown from opening unless I press space with it focused (and after opening, it immediately closes)</p>
<p dir="auto">How do I make the dropdown window background completely invisible for QComboBox?</p>
]]></description><link>https://forum.qt.io/topic/126747/qcombobox-cannot-make-dropdown-window-background-transparent</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 22:55:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126747.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 May 2021 08:53:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QComboBox cannot make dropdown window background transparent on Tue, 18 May 2021 23:01:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/echoreaper">@<bdi>EchoReaper</bdi></a> said in <a href="/post/660252">QComboBox cannot make dropdown window background transparent</a>:</p>
<blockquote>
<pre><code>window-&gt;setFrameStyle(QFrame::NoFrame);
window-&gt;setStyleSheet("* { background-color: green; }");
</code></pre>
</blockquote>
<p dir="auto">add  "QAbstractItemView{background:green;}" to the stylesheet of ui-&gt;comboBox .</p>
]]></description><link>https://forum.qt.io/post/660417</link><guid isPermaLink="true">https://forum.qt.io/post/660417</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Tue, 18 May 2021 23:01:20 GMT</pubDate></item></channel></rss>