16 const bool reverse = (option.direction == Qt::RightToLeft);
17 const int width = (option.rect.height() * 2) / 3;
21 QStyleOptionViewItemV4 opt = option;
23 opt.rect.adjust(width,0,0,0);
25 opt.rect.adjust(0,0,-width,0);
27 if (!(index.model()->flags(index) & Qt::ItemIsEnabled))
29 opt.showDecorationSelected =
true;
30 opt.state |= QStyle::State_Selected;
34 QStyledItemDelegate::paint(painter, opt, index);
38 opt.rect = QRect(option.rect.x(), option.rect.y(),
39 width, option.rect.height());
41 opt.rect = QRect(option.rect.x() + option.rect.width() - width, option.rect.y(),
42 width, option.rect.height());
45 if (index.model()->hasChildren(index))
47 const QWidget *view = opt.widget;
49 QStyle *style = view ? view->style() : qApp->style();
50 style->drawPrimitive(QStyle::PE_IndicatorColumnViewArrow, &opt,