| 15 | {} |
| 16 | |
| 17 | void KDevDocumentViewDelegate::paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const |
| 18 | { |
| 19 | const QAbstractItemModel * model = index.model(); |
| 20 | Q_ASSERT( model ); |
| 21 | |
| 22 | if ( !model->parent( index ).isValid() ) |
| 23 | { |
| 24 | // this is a top-level item. |
| 25 | QStyleOptionViewItem o = option; |
| 26 | o.textElideMode = Qt::ElideLeft; |
| 27 | QItemDelegate::paint( painter, o, index ); |
| 28 | } |
| 29 | else |
| 30 | { |
| 31 | QItemDelegate::paint( painter, option, index ); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | #include "moc_kdevdocumentviewdelegate.cpp" |