<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Cool QProgressBar Stylesheet</title>
	<atom:link href="http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/feed/" rel="self" type="application/rss+xml" />
	<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/</link>
	<description>Your blog is probably better than mine.</description>
	<lastBuildDate>Sun, 05 Feb 2012 05:18:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: gedoes</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-143285</link>
		<dc:creator>gedoes</dc:creator>
		<pubDate>Tue, 16 Aug 2011 13:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-143285</guid>
		<description>How can i make this in qt4.3?</description>
		<content:encoded><![CDATA[<p>How can i make this in qt4.3?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bibhu</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-137394</link>
		<dc:creator>Bibhu</dc:creator>
		<pubDate>Thu, 16 Jun 2011 04:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-137394</guid>
		<description>Hi Dave,
  Can you help me to create a style sheet so that the progress bar looks like a battery ?

thanks.</description>
		<content:encoded><![CDATA[<p>Hi Dave,<br />
  Can you help me to create a style sheet so that the progress bar looks like a battery ?</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-130953</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 11 Apr 2011 12:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-130953</guid>
		<description>Joerg, it&#039;s true. Because Qt refuses to render a rounded border for rectangles whose size is smaller than the border-radius.</description>
		<content:encoded><![CDATA[<p>Joerg, it&#8217;s true. Because Qt refuses to render a rounded border for rectangles whose size is smaller than the border-radius.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joerg</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-130941</link>
		<dc:creator>Joerg</dc:creator>
		<pubDate>Mon, 11 Apr 2011 10:33:18 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-130941</guid>
		<description>Hi Dave,

congrats to this site and topic.

But, have you ever tried to set a value of less than 4?
The chunk isn&#039;t rendered correctly anymore.

Any idea how to solve this problem?

Cheers, Joerg.</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>congrats to this site and topic.</p>
<p>But, have you ever tried to set a value of less than 4?<br />
The chunk isn&#8217;t rendered correctly anymore.</p>
<p>Any idea how to solve this problem?</p>
<p>Cheers, Joerg.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-104325</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Fri, 09 Jul 2010 02:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-104325</guid>
		<description>Hi Dave,

i realised i never got back to you,

yes the code wise changing of the colour-slider worked. just needed to calculate the right blend 

it&#039;s in pyqt, but should be easy to read:

note slider is horizontal with a min value of 0 and max = 20.


            int inValue = getValueFromHeater();
            self.heatProgressBar.setValue(inValue)
            
            # make the slider show blue to red from left to right
            if( inValue &gt;= 0 ):
                percentage = inValue * 0xFF / 20

                #calculate the blend                
                redTo = str(hex(percentage))
                redTo = redTo.replace(&#039;0x&#039;, &#039;&#039;)
                if( len(redTo) &lt;2 ):
                    redTo = &quot;0&quot; + redTo
                blueTo = str(hex(0xFF-percentage))
                blueTo = blueTo.replace(&#039;0x&#039;, &#039;&#039;)
                if( len(blueTo) &lt;2 ):
                    blueTo = &quot;0&quot; + blueTo
                if( inValue == 20):
                    astyle = &quot;QProgressBar {background-image: url(:/IVD/images/transparent.png); border: 2px solid white; border-radius: 8px; } QProgressBar::chunk:horizontal { border-top-left-radius: 4px; border-bottom-left-radius: 4px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border: 1px ; background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #0000FF, stop: 1 #%s00%s ); }&quot; % (redTo, blueTo)
                else:
                    astyle = &quot;QProgressBar {background-image: url(:/IVD/images/transparent.png); border: 2px solid white; border-radius: 8px; } QProgressBar::chunk:horizontal { border-top-left-radius: 4px; border-bottom-left-radius: 4px; border: 1px ; background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #0000FF, stop: 1 #%s00%s ); }&quot; % (redTo, blueTo)
                if( inValue == 1):
                    astyle = &quot;QProgressBar {background-image: url(:/IVD/images/transparent.png); border: 2px solid white; border-radius: 8px; } QProgressBar::chunk:horizontal { border-top-left-radius: 3px; border-bottom-left-radius: 3px; border: 1px ; background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #0000FF, stop: 1 #%s00%s ); }&quot; % (redTo, blueTo)
                self.heatProgressBar.setStyleSheet(QtGui.QApplication.translate(&quot;Form&quot;, astyle, None, QtGui.QApplication.UnicodeUTF8));


thanks for you suggestion !
cheers,
tom</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>i realised i never got back to you,</p>
<p>yes the code wise changing of the colour-slider worked. just needed to calculate the right blend </p>
<p>it&#8217;s in pyqt, but should be easy to read:</p>
<p>note slider is horizontal with a min value of 0 and max = 20.</p>
<p>            int inValue = getValueFromHeater();<br />
            self.heatProgressBar.setValue(inValue)</p>
<p>            # make the slider show blue to red from left to right<br />
            if( inValue &gt;= 0 ):<br />
                percentage = inValue * 0xFF / 20</p>
<p>                #calculate the blend<br />
                redTo = str(hex(percentage))<br />
                redTo = redTo.replace(&#8217;0x&#8217;, &#8221;)<br />
                if( len(redTo) &lt;2 ):<br />
                    redTo = &quot;0&quot; + redTo<br />
                blueTo = str(hex(0xFF-percentage))<br />
                blueTo = blueTo.replace(&#039;0x&#039;, &#039;&#039;)<br />
                if( len(blueTo) &lt;2 ):<br />
                    blueTo = &quot;0&quot; + blueTo<br />
                if( inValue == 20):<br />
                    astyle = &quot;QProgressBar {background-image: url(:/IVD/images/transparent.png); border: 2px solid white; border-radius: 8px; } QProgressBar::chunk:horizontal { border-top-left-radius: 4px; border-bottom-left-radius: 4px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border: 1px ; background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #0000FF, stop: 1 #%s00%s ); }&quot; % (redTo, blueTo)<br />
                else:<br />
                    astyle = &quot;QProgressBar {background-image: url(:/IVD/images/transparent.png); border: 2px solid white; border-radius: 8px; } QProgressBar::chunk:horizontal { border-top-left-radius: 4px; border-bottom-left-radius: 4px; border: 1px ; background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #0000FF, stop: 1 #%s00%s ); }&quot; % (redTo, blueTo)<br />
                if( inValue == 1):<br />
                    astyle = &quot;QProgressBar {background-image: url(:/IVD/images/transparent.png); border: 2px solid white; border-radius: 8px; } QProgressBar::chunk:horizontal { border-top-left-radius: 3px; border-bottom-left-radius: 3px; border: 1px ; background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 #0000FF, stop: 1 #%s00%s ); }&quot; % (redTo, blueTo)<br />
                self.heatProgressBar.setStyleSheet(QtGui.QApplication.translate(&quot;Form&quot;, astyle, None, QtGui.QApplication.UnicodeUTF8));</p>
<p>thanks for you suggestion !<br />
cheers,<br />
tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BA</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-95971</link>
		<dc:creator>BA</dc:creator>
		<pubDate>Mon, 21 Dec 2009 22:08:51 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-95971</guid>
		<description>nevermind, found the issue. it was a small typo in my CSS.

QProgressBar::chunk:disabled is correct</description>
		<content:encoded><![CDATA[<p>nevermind, found the issue. it was a small typo in my CSS.</p>
<p>QProgressBar::chunk:disabled is correct</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-95855</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sat, 19 Dec 2009 21:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-95855</guid>
		<description>BA, have you tried QProgressBar:disabled::chunk?</description>
		<content:encoded><![CDATA[<p>BA, have you tried QProgressBar:disabled::chunk?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BA</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-95780</link>
		<dc:creator>BA</dc:creator>
		<pubDate>Sat, 19 Dec 2009 00:09:46 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-95780</guid>
		<description>Just wondering if you know how to set the style of a progress bar when it&#039;s disabled? I&#039;ve tried QProgressBar::chunk:disabled but that doesn&#039;t seem to work</description>
		<content:encoded><![CDATA[<p>Just wondering if you know how to set the style of a progress bar when it&#8217;s disabled? I&#8217;ve tried QProgressBar::chunk:disabled but that doesn&#8217;t seem to work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe D.</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-94330</link>
		<dc:creator>Joe D.</dc:creator>
		<pubDate>Mon, 30 Nov 2009 22:42:15 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-94330</guid>
		<description>Hey Dave...I worked with you via correspondence at your previous gig and just wanted to wish you the best; I was just googling for any tricks to display greater than 100% in a QProgressBar (not looking very likely without subclassing) and noticed your blog came up near the top of the 2nd page of my results; congrats!</description>
		<content:encoded><![CDATA[<p>Hey Dave&#8230;I worked with you via correspondence at your previous gig and just wanted to wish you the best; I was just googling for any tricks to display greater than 100% in a QProgressBar (not looking very likely without subclassing) and noticed your blog came up near the top of the 2nd page of my results; congrats!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/10/13/cool-qprogressbar-stylesheet/comment-page-1/#comment-92546</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 13 Nov 2009 04:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=509#comment-92546</guid>
		<description>Tom,

I believe that is not possible. You could do it, but you&#039;d have to do it in your C++ code and update your stylesheet after each progress update using setStyleSheet().

Let me know what you find out!

--Dave</description>
		<content:encoded><![CDATA[<p>Tom,</p>
<p>I believe that is not possible. You could do it, but you&#8217;d have to do it in your C++ code and update your stylesheet after each progress update using setStyleSheet().</p>
<p>Let me know what you find out!</p>
<p>&#8211;Dave</p>
]]></content:encoded>
	</item>
</channel>
</rss>

