16 #include <QItemDelegate>
49 const QStyleOptionViewItem &option,
50 const QModelIndex &index )
const
61 w->setAutoFillBackground(
true );
66 w->setMinimumWidth( tv->columnWidth( index.column() ) );
71 QLineEdit *le = w->findChild<QLineEdit*>();
73 w->setMinimumHeight( le->height()*2 );
116 const QStyleOptionViewItem & option,
117 const QModelIndex & index )
const
121 QStyleOptionViewItem myOpt = option;
124 myOpt.state |= QStyle::State_Selected;
126 QItemDelegate::paint( painter, myOpt, index );
128 if ( option.state & QStyle::State_HasFocus )
130 QRect r = option.rect.adjusted( 1, 1, -1, -1 );
131 QPen p( QBrush( QColor( 0, 255, 127 ) ), 2 );
133 painter->setPen( p );
134 painter->drawRect( r );