Hi folks!
I need to change width of branch indicator of QTreeView, but i cannot find corresponding parameter in QStyle class.
![](https://wmpics.pics/di-3W5P.png)
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.
{
if (elem == PE_IndicatorBranch)
if (option->state & State_Children) {
const int width = option->rect.width(); // width is always 20
painter
->setPen
(QPen(Qt
::red));
painter->drawRect(option->rect);
}
}
void drawPrimitive(PrimitiveElement elem, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const
{
if (elem == PE_IndicatorBranch)
if (option->state & State_Children) {
const int width = option->rect.width(); // width is always 20
painter->setPen(QPen(Qt::red));
painter->drawRect(option->rect);
}
}
To copy to clipboard, switch view to plain text mode
![](https://wmpics.pics/di-7K83.png)
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?
Bookmarks