<?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[How to get a 1 pixel black border on a frameless dialog?]]></title><description><![CDATA[<p dir="auto">I have a couple of instances of a Dialog which I don't want a titlebar or widgets, so I call:</p>
<pre><code>setWindowFlags(Qt::FramelessWindowHint);
</code></pre>
<p dir="auto">In the class constructor, however I would like a single pixel, maybe 2 pixel black border around the dialog just to make it clear and standout when it overlays another dialog of the same background colour.</p>
<p dir="auto">I've tried setting the style sheet using:</p>
<pre><code>setStyleSheet("QDialog {border:1px solid black}");
</code></pre>
<p dir="auto">It doesn't do anything.</p>
]]></description><link>https://forum.qt.io/topic/126990/how-to-get-a-1-pixel-black-border-on-a-frameless-dialog</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 06:09:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126990.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 May 2021 00:23:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to get a 1 pixel black border on a frameless dialog? on Wed, 26 May 2021 04:15:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a><br />
Set the stylesheet in the dialog</p>
<p dir="auto">using the editor<br />
<img src="https://ddgobkiprc33d.cloudfront.net/7f10bc64-06e7-4411-8b6e-25488119f873.png" alt="ff728046-364f-4a00-9122-0ecca3e30a23-image.png" class=" img-fluid img-markdown" /><br />
Below is the code<br />
<img src="https://ddgobkiprc33d.cloudfront.net/5e638a49-1714-4d4d-a54b-af64ec20a646.png" alt="f66ebd75-d252-4dac-a630-25bcd71bac09-image.png" class=" img-fluid img-markdown" /><br />
If it didn't solve  can you show more ? like how are you putting stylesheet?</p>
]]></description><link>https://forum.qt.io/post/661565</link><guid isPermaLink="true">https://forum.qt.io/post/661565</guid><dc:creator><![CDATA[Thank You]]></dc:creator><pubDate>Wed, 26 May 2021 04:15:56 GMT</pubDate></item><item><title><![CDATA[Reply to How to get a 1 pixel black border on a frameless dialog? on Wed, 26 May 2021 03:03:35 GMT]]></title><description><![CDATA[<p dir="auto">You can try to override the paintEvent, maybe works.</p>
<p dir="auto">void YourWidget::paintEvent(QPaintEvent *)<br />
{<br />
QStyleOption opt;<br />
opt.init(this);<br />
QPainter p(this);<br />
style()-&gt;drawPrimitive(QStyle::PE_Widget, &amp;opt, &amp;p, this);<br />
}</p>
]]></description><link>https://forum.qt.io/post/661561</link><guid isPermaLink="true">https://forum.qt.io/post/661561</guid><dc:creator><![CDATA[Hanson]]></dc:creator><pubDate>Wed, 26 May 2021 03:03:35 GMT</pubDate></item></channel></rss>