<?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[Transparency effect between image and drawing]]></title><description><![CDATA[<p dir="auto">I want to give a transparency effect to an image, so the underlying drawing could be seen through. Has anybody used this king of effect, often visible in Windows desktop, with Qt ?<br />
I'm grateful for any indication.</p>
]]></description><link>https://forum.qt.io/topic/62553/transparency-effect-between-image-and-drawing</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 00:22:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/62553.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Jan 2016 17:49:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Transparency effect between image and drawing on Wed, 13 Jan 2016 15:15:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a> I noted. So, I tried one after another.</p>
]]></description><link>https://forum.qt.io/post/307144</link><guid isPermaLink="true">https://forum.qt.io/post/307144</guid><dc:creator><![CDATA[Furkas]]></dc:creator><pubDate>Wed, 13 Jan 2016 15:15:59 GMT</pubDate></item><item><title><![CDATA[Reply to Transparency effect between image and drawing on Wed, 13 Jan 2016 14:38:46 GMT]]></title><description><![CDATA[<p dir="auto">yes indeed as you said, dont access any member of the ui variable before calling setupUi() on it.<br />
Also - as the docs of QWidget::setGraphicsEffect() are clearly stating - you cannot reuse a graphicseffect for multiple widgets.</p>
]]></description><link>https://forum.qt.io/post/307139</link><guid isPermaLink="true">https://forum.qt.io/post/307139</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 13 Jan 2016 14:38:46 GMT</pubDate></item><item><title><![CDATA[Reply to Transparency effect between image and drawing on Wed, 13 Jan 2016 14:33:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a> Here the significant code :<br />
#include &lt;QMessageBox&gt;<br />
#include &lt;QStandardPaths&gt;<br />
#include &lt;QFileDialog&gt;<br />
#include &lt;QImageReader&gt;<br />
#include &lt;QTimer&gt;<br />
#include &lt;QtWidgets&gt;</p>
<p dir="auto">#include "radararea.h"<br />
#include "mainwindow.h"<br />
#include "ui_mainwindow.h"</p>
<p dir="auto">MainWindow::MainWindow(QWidget *parent) :<br />
QMainWindow(parent),<br />
ui(new Ui::MainWindow)<br />
{<br />
imageLabel = new QLabel;<br />
imageLabel-&gt;setBackgroundRole(QPalette::Base);<br />
imageLabel-&gt;setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);<br />
imageLabel-&gt;setScaledContents(true);</p>
<pre><code>effect = new QGraphicsOpacityEffect;
effect-&gt;setOpacity(0.6);

//ui-&gt;imaLabel-&gt;setGraphicsEffect(effect); // Nok
//ui-&gt;spinBoxGain-&gt;setGraphicsEffect(effect); // Nok
//ui-&gt;pushButtonACAuto-&gt;setGraphicsEffect(effect); // Nok
//imageLabel-&gt;setGraphicsEffect(effect);  // ok

ui-&gt;setupUi(this);

//ui-&gt;imaLabel-&gt;setGraphicsEffect(effect); // Nok
//ui-&gt;spinBoxGain-&gt;setGraphicsEffect(effect); // Nok
//ui-&gt;pushButtonACAuto-&gt;setGraphicsEffect(effect); // Nok
//imageLabel-&gt;setGraphicsEffect(effect);  // ok

ui-&gt;comboBoxAntType-&gt;addItem(tr("Antenne F1"));
ui-&gt;comboBoxAntType-&gt;addItem(tr("Antenne F2"));
ui-&gt;comboBoxAntType-&gt;addItem(tr("Antenne F3"));

connect(ui-&gt;comboBoxAntType, SIGNAL(currentIndexChanged(int)), SLOT(on_ComboChanged(int)));
</code></pre>
<p dir="auto">......<br />
I think UI is not available  before the call to setupUI(), but it's the same after.</p>
]]></description><link>https://forum.qt.io/post/307136</link><guid isPermaLink="true">https://forum.qt.io/post/307136</guid><dc:creator><![CDATA[Furkas]]></dc:creator><pubDate>Wed, 13 Jan 2016 14:33:44 GMT</pubDate></item><item><title><![CDATA[Reply to Transparency effect between image and drawing on Wed, 13 Jan 2016 14:09:52 GMT]]></title><description><![CDATA[<p dir="auto">hard to tell ... you're probably trying to accessing a uninitialized/deleted variable.<br />
show some code pls.</p>
]]></description><link>https://forum.qt.io/post/307124</link><guid isPermaLink="true">https://forum.qt.io/post/307124</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 13 Jan 2016 14:09:52 GMT</pubDate></item><item><title><![CDATA[Reply to Transparency effect between image and drawing on Wed, 13 Jan 2016 14:06:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a>  Thanks for your advice. It seems to be the right tool. But I have troubles with this class. I get an exception "Read acces violation" any time I try to call setGraphicsEffect() with this effect on a widget in my UI. I have not found in the manual what is the restriction.<br />
It's ok if I add a QLabel outside of the UI.</p>
]]></description><link>https://forum.qt.io/post/307123</link><guid isPermaLink="true">https://forum.qt.io/post/307123</guid><dc:creator><![CDATA[Furkas]]></dc:creator><pubDate>Wed, 13 Jan 2016 14:06:12 GMT</pubDate></item><item><title><![CDATA[Reply to Transparency effect between image and drawing on Tue, 12 Jan 2016 10:30:16 GMT]]></title><description><![CDATA[<p dir="auto">see QGraphicsOpacityEffect class in case you want to make the whole widget transparent<br />
Its also possible to add a linear opacity (gradient-like), but there is more work involved.</p>
]]></description><link>https://forum.qt.io/post/306871</link><guid isPermaLink="true">https://forum.qt.io/post/306871</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Tue, 12 Jan 2016 10:30:16 GMT</pubDate></item><item><title><![CDATA[Reply to Transparency effect between image and drawing on Tue, 12 Jan 2016 08:50:34 GMT]]></title><description><![CDATA[<p dir="auto">@Wieland,<br />
I'm talking about QWidgets, and I want just one transparent object, I think a QLabel may be cool.</p>
]]></description><link>https://forum.qt.io/post/306833</link><guid isPermaLink="true">https://forum.qt.io/post/306833</guid><dc:creator><![CDATA[Furkas]]></dc:creator><pubDate>Tue, 12 Jan 2016 08:50:34 GMT</pubDate></item><item><title><![CDATA[Reply to Transparency effect between image and drawing on Mon, 11 Jan 2016 18:44:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/furkas">@<bdi>Furkas</bdi></a> Hi! Are we talking about QWidgets or QtQuick? Do you want to make a whole window transparent or just an object within a window?</p>
]]></description><link>https://forum.qt.io/post/306714</link><guid isPermaLink="true">https://forum.qt.io/post/306714</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 11 Jan 2016 18:44:50 GMT</pubDate></item></channel></rss>