mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* React to more view changes in GridView, making sure we display covers of visible items.
This commit is contained in:
@@ -112,12 +112,14 @@ GridView::setProxyModel( PlayableProxyModel* model )
|
||||
disconnect( m_proxyModel, SIGNAL( filterChanged( QString ) ), this, SLOT( onFilterChanged( QString ) ) );
|
||||
disconnect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( verifySize() ) );
|
||||
disconnect( m_proxyModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( verifySize() ) );
|
||||
disconnect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( onViewChanged() ) );
|
||||
disconnect( m_proxyModel, SIGNAL( modelReset() ), this, SLOT( layoutItems() ) );
|
||||
}
|
||||
|
||||
m_proxyModel = model;
|
||||
connect( m_proxyModel, SIGNAL( filterChanged( QString ) ), SLOT( onFilterChanged( QString ) ) );
|
||||
connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( verifySize() ), Qt::QueuedConnection );
|
||||
connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ), Qt::QueuedConnection );
|
||||
connect( m_proxyModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), SLOT( verifySize() ), Qt::QueuedConnection );
|
||||
connect( m_proxyModel, SIGNAL( modelReset() ), SLOT( layoutItems() ), Qt::QueuedConnection );
|
||||
|
||||
@@ -362,6 +364,8 @@ GridView::onFilterChanged( const QString& )
|
||||
{
|
||||
if ( selectedIndexes().count() )
|
||||
scrollTo( selectedIndexes().at( 0 ), QAbstractItemView::PositionAtCenter );
|
||||
|
||||
onViewChanged();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user