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. QProgressBar - Chunk round corners instead of rectangular

QProgressBar - Chunk round corners instead of rectangular

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 2.6k Views
  • 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.
  • D Offline
    D Offline
    d_ly56
    wrote on last edited by
    #1

    Hey All,

    I currently am having trouble with an issue with QProgressbar. I have created a progressbar that has rounded corners, but the QProgressBar:: Chunk can't seem to round off at the edges...
    Attached below is my code and a picture for all to see!

    QProgressBar {
        border: 2px solid grey;
        border-radius: 10px;
        text-align: center;
    }
    
    QProgressBar::chunk {
        background-color: #00FF7F;
        width: 10px;
        margin: 0.5px;
        border-bottom-right-radius: 10px;
        border-bottom-left-radius: 10px;
    }
    

    0_1532109943343_progressbar.PNG

    So, if you take a look at that photo, you can clearly see at the edges the chunk are overlapping the rounded corners. I tried the border-bottom-right-radius and left, I was reading this on stackoverflow, and it didn't help so I'm thinking my issue might be something else.

    If anyone can help me in the right direction with this, I would be very appreciative!

    Thanks all,
    Derek

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      What if you just add a margin to your QProgressBar, try like 4 pixels. Should keep the chunks inside.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      4
      • D Offline
        D Offline
        d_ly56
        wrote on last edited by
        #3

        Hey @ambershark ,

        I apologize for the late reply! But yes, I just tried this and it works!!! Thank you so much for your time and help!!

        Derek

        1 Reply Last reply
        1

        • Login

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