Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]QProgressBar stylesheet problem
Forum Update on Tuesday, May 27th 2025

[SOLVED]QProgressBar stylesheet problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    glararan
    wrote on 8 May 2012, 17:47 last edited by
    #1

    Hi,
    I styling my ProgressBar

    I customize progress percent image.

    But... i have problem with one... 50% - Qt Creator show good, 50% in App show 100%... i don't know why

    Stylesheet:
    @QProgressBar#progressBar
    {
    border:0;
    background-color:rgb(0,0,0);
    }

    QProgressBar#progressBar::chunk:horizontal
    {
    background-image:url(:/img/barV2);
    width:1px;
    }@

    Image:
    !http://www.sdilej.eu/pics/6f4e71defd6125a232bc6d1a8e8df930.png(Image)!

    Top: App
    Bot: Qt creator

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jeroentjehome
      wrote on 8 May 2012, 18:19 last edited by
      #2

      The size of the progressbar is not connected to the way you want to display it. The stylesheet only changes the way it is displayed.
      The % completed size is determined by two properties: Maximum and Value (minimum also, but we will assume you have 0 as minimum).
      You might want to try and set the:
      @
      QProgressBar::setMaximum(Your max percentage here); // Might be in constructor?
      .....
      QProgressBar::setValue(current persentage here);
      @

      Greetz, Jeroen

      1 Reply Last reply
      0
      • G Offline
        G Offline
        glararan
        wrote on 8 May 2012, 18:51 last edited by
        #3

        I add it to code...nothing changed

        EDIT:SOLVED

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sam
          wrote on 8 May 2012, 19:59 last edited by
          #4

          [quote author="glararan" date="1336503116"]I add it to code...nothing changed

          EDIT:SOLVED[/quote]

          Hi,
          You need to EDIT your first post and append SOLVED if you got the answer. If not then you can provide your code so that we can figure out the above behavior of the progress bar. As it has already been explained above that stylesheets mostly deals with the look and feel of the component.

          Thanks :)

          1 Reply Last reply
          0

          1/4

          8 May 2012, 17:47

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved