In my application I use QTreeView that contains progressbar items inside its cells. Progressbar controls are drawn inside QStyledItemDelegate::paint procedure in the following way:
QStyleOptionViewItemV4 optionV4 = option;
initStyleOption(&optionV4, index);
QStyle * style
= optionV4.
widget->style
();
//....
progressOpt.orientation = Qt::Horizontal;
//....
style
->drawControl
(QStyle::CE_ProgressBar,
&progressOpt, painter
);
QStyleOptionViewItemV4 optionV4 = option;
initStyleOption(&optionV4, index);
QStyle * style = optionV4.widget->style();
//....
QStyleOptionProgressBarV2 progressOpt;
progressOpt.orientation = Qt::Horizontal;
//....
style->drawControl(QStyle::CE_ProgressBar, &progressOpt, painter);
To copy to clipboard, switch view to plain text mode
Is it possible to change the style of such progressbar controls with qss?
Bookmarks