When using editorEvent in QItemDelegate, the QStyle::State_Selected doesn't arrive in the editorEvent but it does in paint. I'm using QStyleOptionViewItem.state.
{
if((option.
state & QStyle::State_Selected) == QStyle::State_Selected) {
//This does not arrive.
}
}
{
if((option.
state & QStyle::State_Selected) == QStyle::State_Selected) {
//This works
}
}
bool InCallItemDelegate::editorEvent(QEvent * event, QAbstractItemModel * model
, const QStyleOptionViewItem & option, const QModelIndex & index )
{
if((option.state & QStyle::State_Selected) == QStyle::State_Selected)
{
//This does not arrive.
}
}
void InCallItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
{
if((option.state & QStyle::State_Selected) == QStyle::State_Selected)
{
//This works
}
}
To copy to clipboard, switch view to plain text mode
Should I capture the selection in some other way? Could be a QT bug? Im using 4.7.0
Thanks
Ramiro
Bookmarks