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 );
90 QVariant oldValue = model->data( index, Qt::EditRole );
117 const QStyleOptionViewItem & option,
118 const QModelIndex &
index )
const
122 QStyleOptionViewItem myOpt = option;
125 myOpt.state |= QStyle::State_Selected;
127 QItemDelegate::paint( painter, myOpt, index );
129 if ( option.state & QStyle::State_HasFocus )
131 QRect r = option.rect.adjusted( 1, 1, -1, -1 );
132 QPen p( QBrush( QColor( 0, 255, 127 ) ), 2 );
134 painter->setPen( p );
135 painter->drawRect( r );