Commit 91d00d90 authored by Jakob Leben's avatar Jakob Leben

Qt iconView: initial attempt at item browsing/playing

parent 314f3854
...@@ -103,4 +103,18 @@ PlIconView::PlIconView( PLModel *model, QWidget *parent ) : QListView( parent ) ...@@ -103,4 +103,18 @@ PlIconView::PlIconView( PLModel *model, QWidget *parent ) : QListView( parent )
PlListViewItemDelegate *pl = new PlListViewItemDelegate(); PlListViewItemDelegate *pl = new PlListViewItemDelegate();
setItemDelegate( pl ); setItemDelegate( pl );
CONNECT( this, activated( const QModelIndex & ), this, activate( const QModelIndex & ) );
}
void PlIconView::activate( const QModelIndex & index )
{
if( model()->hasChildren( index ) )
setRootIndex( index );
else
{
PLModel *plModel = qobject_cast<PLModel*>( model() );
if( !plModel ) return;
plModel->activateItem( index );
}
} }
...@@ -47,6 +47,8 @@ class PlIconView : public QListView ...@@ -47,6 +47,8 @@ class PlIconView : public QListView
public: public:
PlIconView( PLModel *model, QWidget *parent = 0 ); PlIconView( PLModel *model, QWidget *parent = 0 );
public slots:
void activate( const QModelIndex & index );
}; };
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment