I need to create a QProgressBar
where we can choose a range, the minimum and the maximum value.
Until now, I used a stylesheet for the same but the program is working(although not perfectly).
Stylesheet will allow me each time to change my background color and also bar color and each time I should add a small value because I'm using a qgradientline
inside of stylesheet (not a good idea because of parsing time and also the progress bar is not generic)
image that shows what i want to do exactly
You can find the stylesheet xml below :
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)));