Nominate our 2022 Qt Champions!

QProgressBar chunk

  • can i set first(value = 0) and last(value=100) chunk image in progressbar?

    something like this:

    QProgressBar::chunk:first {


    [EDIT: code formatting, please wrap in @-tags, Volker]

  • Hello,

    in QWidget world you can use setRange(min,max) slot to achieve this. In case of QML desktop components you can use minimumValue and maximumValue properties.


    ps: QML related questions should be asked in QtQuick subcategory of this forum.

  • hm..

    It's QProgressbar stylesheet

    @QProgressBar::chunk { background: red }@ -- set all chunk red

    I need set first and last chunk different ... i try:
    @QProgressBar::chunk:first { background: green }
    QProgressBar::chunk:last { background: blue }@

    but it does not work

    how can i do this

  • AFAIK, this is not possible.

  • I'll double it as not possible, I believe. You could add your own signal handler to change the progress bar style sheet when it is completed with a regular call to setStyleSheet.

Log in to reply