{
if (index.column() == 1)
{
button.rect = option.rect;
button.
text = QString::fromUtf8("RemoveRow");
button.
state=QStyle::State_Raised |QStyle
::State_Enabled;
}
}
void buttonDelegate::paint( QPainter *painter,const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
if (index.column() == 1)
{
QStyleOptionButton button;
button.rect = option.rect;
button.text = QString::fromUtf8("RemoveRow");
button.state=QStyle::State_Raised |QStyle::State_Enabled;
QApplication::style()->drawControl(QStyle::CE_PushButton,&button, painter);
}
}
To copy to clipboard, switch view to plain text mode
I managed to make the delegate like that,but there is another question arising here which is how can I catch the paint event when user moves the mouse over the row containing the drawn widget? so I can paint mouse over state of the widget
Bookmarks