<?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[QStyleOptionProgressBar no longer rendering in QT 6.*]]></title><description><![CDATA[<p dir="auto">I use QStyleOptionProgressBar in my Application to have a percent indicator in a Tree view. The code stopped working with QT 6.* . In QT 5.* the same code still works. Is this a bug or has something changed in the way delegate painting is handled?</p>
<p dir="auto">The code is:</p>
<pre><code>void InstrumentDelegate::paint(QPainter *painter, const QStyleOptionViewItem &amp;option,
                               const QModelIndex &amp;index) const
{
  painter-&gt;save();

  // Setup basic layout
  QStyleOptionProgressBar progressBarOption = {};
  progressBarOption.state = QStyle::State_Enabled;
  progressBarOption.bottomToTop = false;
  progressBarOption.direction = QApplication::layoutDirection();
  progressBarOption.rect = option.rect.adjusted(0, 0, 0, 0);
  progressBarOption.minimum = 0;
  progressBarOption.maximum = 100;
  progressBarOption.textAlignment = Qt::AlignCenter;
  progressBarOption.textVisible = true;

  // Set the progress and text values of the style option.
  double percent = 50.0;
  progressBarOption.progress = (int)(percent);
  progressBarOption.text = QString::asprintf("%.2f%%", percent);

  //painter-&gt;fillRect(progressBarOption.rect, QColor::fromRgb(255,0,0));
  QApplication::style()-&gt;drawControl(QStyle::CE_ProgressBar, &amp;progressBarOption, painter);

  painter-&gt;restore();
}
</code></pre>
<p dir="auto">The result with QT6:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/11e82fea-3efc-406e-8656-56b74959b855.png" alt="Screenshot from 2024-06-17 13-04-27.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The result with QT5:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/019c64c7-b8b2-4e56-9859-526d0246a1a5.png" alt="Screenshot from 2024-06-17 13-04-48.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I created a small reproducer:<br />
<a href="https://seafile.rlp.net/f/b1589ae16f7245d9b50d/?dl=1" target="_blank" rel="noopener noreferrer nofollow ugc">https://seafile.rlp.net/f/b1589ae16f7245d9b50d/?dl=1</a></p>
<p dir="auto">My environment:<br />
Fedora 39<br />
QT 6.7.1 installed via the QT Maintenance tool.</p>
]]></description><link>https://forum.qt.io/topic/157287/qstyleoptionprogressbar-no-longer-rendering-in-qt-6</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 18:54:39 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/157287.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 17 Jun 2024 11:09:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QStyleOptionProgressBar no longer rendering in QT 6.* on Mon, 17 Jun 2024 19:35:11 GMT]]></title><description><![CDATA[<p dir="auto">You forgot to properly set the orientation in QStyleOptionProgressBar.state to QStyle::State_Horizontal.</p>
]]></description><link>https://forum.qt.io/post/802848</link><guid isPermaLink="true">https://forum.qt.io/post/802848</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 17 Jun 2024 19:35:11 GMT</pubDate></item><item><title><![CDATA[Reply to QStyleOptionProgressBar no longer rendering in QT 6.* on Mon, 17 Jun 2024 16:34:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> It seems a general rendering but. With the  <code>-style windows</code> option the text is missing and the progress bar should be at 50%:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/51637f56-59ce-4e4d-9308-cd60d3b44610.png" alt="Screenshot from 2024-06-17 18-24-56.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">So it seems to be a general problem. I created the bug report <a href="https://bugreports.qt.io/browse/QTBUG-126426" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-126426</a>.</p>
]]></description><link>https://forum.qt.io/post/802837</link><guid isPermaLink="true">https://forum.qt.io/post/802837</guid><dc:creator><![CDATA[Max S.]]></dc:creator><pubDate>Mon, 17 Jun 2024 16:34:09 GMT</pubDate></item><item><title><![CDATA[Reply to QStyleOptionProgressBar no longer rendering in QT 6.* on Mon, 17 Jun 2024 14:40:44 GMT]]></title><description><![CDATA[<p dir="auto">Please start with '-style fusion' and '-style windows' to see if it is a fusion or windows style problem. If so please provide a <strong>minimal</strong> compilable example in the <a href="https://bugreports.qt.io/" target="_blank" rel="noopener noreferrer nofollow ugc">bug</a>.</p>
]]></description><link>https://forum.qt.io/post/802832</link><guid isPermaLink="true">https://forum.qt.io/post/802832</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 17 Jun 2024 14:40:44 GMT</pubDate></item><item><title><![CDATA[Reply to QStyleOptionProgressBar no longer rendering in QT 6.* on Mon, 17 Jun 2024 14:19:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pl45m4">@<bdi>Pl45m4</bdi></a> I logged out and in again with xorg enabled.</p>
<p dir="auto">But the rendering behaviour stays the same. So it seems to be an QT 6.* issue.</p>
<p dir="auto">I validated that I use x11 via the terminal.</p>
<pre><code>[max]~&gt; loginctl 
SESSION  UID USER      SEAT  TTY  STATE  IDLE SINCE
     10 1001 max seat0 tty2 active no        

1 sessions listed.
[max]~&gt; loginctl show-session 10 -p Type
Type=x11
</code></pre>
]]></description><link>https://forum.qt.io/post/802828</link><guid isPermaLink="true">https://forum.qt.io/post/802828</guid><dc:creator><![CDATA[Max S.]]></dc:creator><pubDate>Mon, 17 Jun 2024 14:19:20 GMT</pubDate></item><item><title><![CDATA[Reply to QStyleOptionProgressBar no longer rendering in QT 6.* on Mon, 17 Jun 2024 11:48:56 GMT]]></title><description><![CDATA[<p dir="auto">@Max-S said in <a href="/post/802798">QStyleOptionProgressBar no longer rendering in QT 6.*</a>:</p>
<blockquote>
<p dir="auto">My environment:<br />
Fedora 39</p>
</blockquote>
<p dir="auto">Wayland?<br />
Could be a wayland issue then.<br />
When using the Forum Search you will see that there are a lot window/rendering issues with Qt6 and wayland.</p>
]]></description><link>https://forum.qt.io/post/802807</link><guid isPermaLink="true">https://forum.qt.io/post/802807</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Mon, 17 Jun 2024 11:48:56 GMT</pubDate></item></channel></rss>