Qt 6.11 is out! See what's new in the release
blog
QStyleOptionProgressBarV2 adding stylesheet , how can it be done ?
General and Desktop
1
Posts
1
Posters
1.0k
Views
1
Watching
-
I have ListWidgetItem Deleget , in the paint method i drow progress bar like this :
@ QStyleOptionProgressBarV2 optionProgress;
optionProgress.rect = ProgressBarRec; optionProgress.maximum = 100; optionProgress.minimum = 0; optionProgress.progress = 0; optionProgress.textVisible = false; optionProgress.orientation = Qt::Horizontal; QApplication::style()->drawControl(QStyle::CE_ProgressBar, &optionProgress, painter, 0);@
all working great and i see the progressBar , but now i want to style it , and i can't find any way to do it ,
how do i style QStyleOptionProgressBarV2
with this :@ QProgressBar:horizontal {
border: 1px solid gray;
border-radius: 3px;
background: white;
padding: 1px;
}
QProgressBar::chunk:horizontal {
background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 green, stop: 1 white);
}
@