Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QprogressBar minValue and maxvalue changes different color



  • 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


Log in to reply