mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 11:50:37 +02:00
* OverlayWidget needs to update when items get removed, too.
This commit is contained in:
@@ -47,6 +47,7 @@ OverlayWidget::OverlayWidget( QAbstractItemView* parent )
|
|||||||
if ( m_parent->model() )
|
if ( m_parent->model() )
|
||||||
{
|
{
|
||||||
connect( m_parent->model(), SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ), Qt::UniqueConnection );
|
connect( m_parent->model(), SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ), Qt::UniqueConnection );
|
||||||
|
connect( m_parent->model(), SIGNAL( rowsRemoved( QModelIndex, int, int ) ), SLOT( onViewChanged() ), Qt::UniqueConnection );
|
||||||
}
|
}
|
||||||
connect( m_parent, SIGNAL( modelChanged() ), SLOT( onViewModelChanged() ) );
|
connect( m_parent, SIGNAL( modelChanged() ), SLOT( onViewModelChanged() ) );
|
||||||
|
|
||||||
@@ -131,6 +132,7 @@ void
|
|||||||
OverlayWidget::onViewChanged()
|
OverlayWidget::onViewChanged()
|
||||||
{
|
{
|
||||||
PlayableProxyModel* model = qobject_cast<PlayableProxyModel*>( m_parent->model() );
|
PlayableProxyModel* model = qobject_cast<PlayableProxyModel*>( m_parent->model() );
|
||||||
|
|
||||||
if ( m_text.isEmpty() || ( model && ( model->rowCount( QModelIndex() ) || model->isLoading() ) ) )
|
if ( m_text.isEmpty() || ( model && ( model->rowCount( QModelIndex() ) || model->isLoading() ) ) )
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
|
Reference in New Issue
Block a user