Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved QprogressBar minValue and maxvalue changes different color

    Mobile and Embedded
    1
    1
    91
    Loading More Posts
    • 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.
    • B
      benamiar last edited by

      Hello guys,
      i need to create a QProgressBar where we can choose a range and also the minimim ans the maximum value.
      0_1563469491105_value.jpg
      the white value can change

       setStyleSheet(QString("QProgressBar{background-color: %2; border: 2px solid %2; border-radius: 1px; margin: 0px; text-align: center;}"
                                "Q2ProgressBar:disabled{background-color: %3; border: 2px solid %3; border-radius: 1px; margin: 0px; text-align: center;}"
                            "QProgressBar::chunk{background-color: qlineargradient(x0: 0, x2: 1, stop : 0 %1, stop: %5 %1, stop: 0.%6 %4, stop: 1 %4); margin: 0px}"
                               ).arg(Q2UiColorsLocator::get().getDispText().name(),
                                     Q2UiColorsLocator::get().getDispText().name(),
                                     Q2UiColorsLocator::get().getDisabled().name(),
                                     Q2UiColorsLocator::get().getDispBackground().name())
                                    .arg(min+0.00001)
                                    .arg(((min)+0.00002)));
      
      

      but seems to be like like a diy solution because each time we should add 0.0000001 to not have a gradiant color and also not working 100% so if you have any idea i'll take it thanks so much

      1 Reply Last reply Reply Quote 0
      • First post
        Last post