{"id":509,"date":"2009-10-13T14:28:51","date_gmt":"2009-10-13T20:28:51","guid":{"rendered":"http:\/\/thesmithfam.org\/blog\/?p=509"},"modified":"2019-08-12T07:15:46","modified_gmt":"2019-08-12T13:15:46","slug":"cool-qprogressbar-stylesheet","status":"publish","type":"post","link":"https:\/\/thesmithfam.org\/blog\/2009\/10\/13\/cool-qprogressbar-stylesheet\/","title":{"rendered":"Cool QProgressBar Stylesheet"},"content":{"rendered":"<p>Qt&#8217;s powerful stylesheet system can make your boring progress bars look really cool.<\/p>\n<p><b>Screenshot:<\/b><\/p>\n<p><img decoding=\"async\" src=\"\/images\/qt-progress-bar-style-sheet.png\" \/><\/p>\n<p><b>Here&#8217;s the code:<\/b><\/p>\n<p><code style=\"whitespace: nowrap\">QProgressBar {<br \/>\nborder: 1px solid black;<br \/>\ntext-align: top;<br \/>\npadding: 1px;<br \/>\nborder-bottom-right-radius: 7px;<br \/>\nborder-bottom-left-radius: 7px;<br \/>\nbackground: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0,<br \/>\nstop: 0 #fff,<br \/>\nstop: 0.4999 #eee,<br \/>\nstop: 0.5 #ddd,<br \/>\nstop: 1 #eee );<br \/>\nwidth: 15px;<br \/>\n}<\/p>\n<p>QProgressBar::chunk {<br \/>\nbackground: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0,<br \/>\nstop: 0 #78d,<br \/>\nstop: 0.4999 #46a,<br \/>\nstop: 0.5 #45a,<br \/>\nstop: 1 #238 );<br \/>\nborder-bottom-right-radius: 7px;<br \/>\nborder-bottom-left-radius: 7px;<br \/>\nborder: 1px solid black;<br \/>\n}<\/code><\/p>\n<p>And here&#8217;s the <a href=\"\/files\/CoolProgressBars.ui\">.ui file<\/a> you can open in Designer (right-click that link and choose &#8220;Save as&#8230;&#8221;).<\/p>\n<p>Happy hacking!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Qt&#8217;s powerful stylesheet system can make your boring progress bars look really cool. Screenshot: Here&#8217;s the code: QProgressBar { border: 1px solid black; text-align: top; padding: 1px; border-bottom-right-radius: 7px; border-bottom-left-radius: 7px; background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #fff, stop: 0.4999 #eee, stop: 0.5 #ddd, stop: 1 #eee ); width: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-509","post","type-post","status-publish","format-standard","hentry","category-code-and-cruft"],"_links":{"self":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/comments?post=509"}],"version-history":[{"count":11,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions"}],"predecessor-version":[{"id":1530,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions\/1530"}],"wp:attachment":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/media?parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/categories?post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/tags?post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}