1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 23:39:42 +01:00

* Fixed PlaylistItemDelegate swallowing mouse events, which prevented TrackView from triggering D&D operations.

This commit is contained in:
Christian Muehlhaeuser 2013-04-26 06:06:44 +02:00
parent 9a1ed86d62
commit 2b6081f4c7

View File

@ -287,14 +287,14 @@ PlaylistItemDelegate::paintDetailed( QPainter* painter, const QStyleOptionViewIt
bool
PlaylistItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index )
{
Q_UNUSED( model );
Q_UNUSED( option );
QStyledItemDelegate::editorEvent( event, model, option, index );
if ( event->type() != QEvent::MouseButtonRelease &&
event->type() != QEvent::MouseMove &&
event->type() != QEvent::MouseButtonPress &&
event->type() != QEvent::Leave )
{
return false;
}
bool hoveringInfo = false;
if ( m_infoButtonRects.contains( index ) )
@ -319,8 +319,8 @@ PlaylistItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, con
emit updateIndex( m_hoveringOver );
}
event->accept();
return true;
// We return false here so the view can still decide to process/trigger things like D&D events
return false;
}
// reset mouse cursor. we switch to a pointing hand cursor when hovering an info button
@ -369,12 +369,6 @@ PlaylistItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, con
event->accept();
return true;
}
else if ( event->type() == QEvent::MouseButtonPress )
{
// Stop the whole item from having a down click action as we just want the info button to be clicked
event->accept();
return true;
}
}
return false;