Hi folks!

I need to change width of branch indicator of QTreeView, but i cannot find corresponding parameter in QStyle class.



I've tried to reimplement all virtual methods in QCommonStyle class which return int, QSize or QRect but the width of branch indicator is always 20.

Qt Code:
  1. void drawPrimitive(PrimitiveElement elem, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const
  2. {
  3. if (elem == PE_IndicatorBranch)
  4. if (option->state & State_Children) {
  5. const int width = option->rect.width(); // width is always 20
  6. painter->setPen(QPen(Qt::red));
  7. painter->drawRect(option->rect);
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 


I know that it seems to be possible to do using stylesheets, but i need to do that in styles, no stylesheets.
How could i resize this indicator?