QModelIndex() );
}
-/* Delete and Suppr key remove the selection
- FilterKey function and code function */
-void StandardPLPanel::keyPressEvent( QKeyEvent *e )
+void StandardPLPanel::wheelEvent( QWheelEvent *e )
{
- switch( e->key() )
+ // Accept this event in order to prevent unwanted volume up/down changes
+ e->accept();
+}
+
+bool StandardPLPanel::eventFilter ( QObject * watched, QEvent * event )
+{
+ if (event->type() == QEvent::KeyPress)
{
- case Qt::Key_Back:
- case Qt::Key_Delete:
- deleteSelection();
- break;
+ QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+ if( keyEvent->key() == Qt::Key_Delete ||
+ keyEvent->key() == Qt::Key_Back )
+ {
+ deleteSelection();
+ return true;
+ }
}
+ return false;
}
void StandardPLPanel::deleteSelection()
this, popupPlView( const QPoint & ) );
CONNECT( iconView, activated( const QModelIndex & ),
this, activate( const QModelIndex & ) );
-
+ iconView->installEventFilter( this );
layout->addWidget( iconView, 1, 0, 1, -1 );
}
this, popupPlView( const QPoint & ) );
CONNECT( listView, activated( const QModelIndex & ),
this, activate( const QModelIndex & ) );
-
+ listView->installEventFilter( this );
layout->addWidget( listView, 1, 0, 1, -1 );
}
this, popupSelectColumn( QPoint ) );
CONNECT( treeView, customContextMenuRequested( const QPoint & ),
this, popupPlView( const QPoint & ) );
+ treeView->installEventFilter( this );
/* SignalMapper for columns */
selectColumnsSigMapper = new QSignalMapper( this );
assert( 0 );
}
-void StandardPLPanel::wheelEvent( QWheelEvent *e )
-{
- // Accept this event in order to prevent unwanted volume up/down changes
- e->accept();
-}
-
void StandardPLPanel::activate( const QModelIndex &index )
{
if( model->hasChildren( index ) )