Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]QProgressBar stylesheet problem
Qt 6.12 LTS is out! See what's new in the release blog

[SOLVED]QProgressBar stylesheet problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 5.1k 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 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
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on 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 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 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

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt
          • Unsolved