<?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[Empty space shown next to progress bar in QProgressDialog]]></title><description><![CDATA[<p dir="auto">I have a <code>QProgressDialog</code> in my application. I have hidden the text of the progress bar in that dialog, but there's an empty space on the right side of that progress bar.</p>
<p dir="auto">This is what I did:</p>
<pre><code>QLabel *label = new QLabel("Sync with entities started by user: " + szUser + ". Please wait...");

label-&gt;setStyleSheet("color:rgb(255,255,255);"
                     "font-size: 15px;"
                     "border: 1px solid rgb(72,72,72)");

progressDialogSync.setStyleSheet("QProgressDialog {"
                                 "    background-color:rgb(72,72,72);"
                                 "    padding: 20px;"
                                 "    border: 3px solid rgb(50,50,50);"
                                 "    border-radius: 5px;"
                                 "}"
                                 "QProgressBar {"
                                 "    border: 2px solid white;"
                                 "    padding: 1px;"
                                 "}");

progressDialogSync.setCancelButton(nullptr);
progressDialogSync.setLabel(label);
progressDialogSync.setMinimum(0);
progressDialogSync.setMaximum(0);
progressDialogSync.setAutoClose(true);
progressDialogSync.resize(progressDialogSync.width(), 100);
progressDialogSync.setWindowFlags(Qt::FramelessWindowHint);
progressDialogSync.setWindowModality(Qt::ApplicationModal);

QProgressBar *bar = progressDialogSync.findChild&lt;QProgressBar *&gt;();
bar != nullptr ? bar-&gt;setTextVisible(false) : void();

while(bSyncInProgress) {
    progressDialogSync.exec();
}
</code></pre>
<p dir="auto">And this is how it looks:</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/84ca9320-0a40-4b25-a9b8-1e2ac508f6b4.png" alt="bc385e27-de09-4b2e-9e23-319e5ec68870-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">How do I get rid of that empty space so that my progress bar is either centered or takes up the width of the dialog box.</p>
]]></description><link>https://forum.qt.io/topic/145223/empty-space-shown-next-to-progress-bar-in-qprogressdialog</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 10:56:41 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145223.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 May 2023 11:54:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Empty space shown next to progress bar in QProgressDialog on Wed, 31 May 2023 06:11:53 GMT]]></title><description><![CDATA[<p dir="auto">I created a clean project and used the same code, and there was no empty space on the right. Then I checked if my project had a stylesheet set for the QProgressBar in general in the ".qss" file. Turns out someone before me had set there a margin on the right side of the progress bar. Removing that resolved my problem. Only if I checked that a little sooner.</p>
]]></description><link>https://forum.qt.io/post/760006</link><guid isPermaLink="true">https://forum.qt.io/post/760006</guid><dc:creator><![CDATA[ScleaverZer0ne]]></dc:creator><pubDate>Wed, 31 May 2023 06:11:53 GMT</pubDate></item><item><title><![CDATA[Reply to Empty space shown next to progress bar in QProgressDialog on Tue, 30 May 2023 04:02:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joecfd">@<bdi>JoeCFD</bdi></a> I'm on Windows 10 using Qt 5.13</p>
]]></description><link>https://forum.qt.io/post/759814</link><guid isPermaLink="true">https://forum.qt.io/post/759814</guid><dc:creator><![CDATA[ScleaverZer0ne]]></dc:creator><pubDate>Tue, 30 May 2023 04:02:07 GMT</pubDate></item><item><title><![CDATA[Reply to Empty space shown next to progress bar in QProgressDialog on Mon, 29 May 2023 16:03:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scleaverzer0ne">@<bdi>ScleaverZer0ne</bdi></a> what is your Qt version? And OS?</p>
]]></description><link>https://forum.qt.io/post/759764</link><guid isPermaLink="true">https://forum.qt.io/post/759764</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Mon, 29 May 2023 16:03:34 GMT</pubDate></item><item><title><![CDATA[Reply to Empty space shown next to progress bar in QProgressDialog on Mon, 29 May 2023 06:45:12 GMT]]></title><description><![CDATA[<p dir="auto">Would love some input on this</p>
]]></description><link>https://forum.qt.io/post/759709</link><guid isPermaLink="true">https://forum.qt.io/post/759709</guid><dc:creator><![CDATA[ScleaverZer0ne]]></dc:creator><pubDate>Mon, 29 May 2023 06:45:12 GMT</pubDate></item></channel></rss>