IconView: Deselect items that are hidden by the filter

during selectAll and invertSelection
This resolves bug 2750

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 057d9fe7a4)
v3.5.13-sru
Slávek Banko 7 years ago
parent f979942b32
commit e6fdc7463e

@ -3867,11 +3867,11 @@ void QIconView::selectAll( bool select )
rr = rr.unite( item->rect() ); rr = rr.unite( item->rect() );
changed = TRUE; changed = TRUE;
} }
else { }
if ( FALSE != item->isSelected() ) { else {
item->setSelected( FALSE, TRUE ); if ( FALSE != item->isSelected() ) {
changed = TRUE; item->setSelected( FALSE, TRUE );
} changed = TRUE;
} }
} }
} }
@ -3901,8 +3901,16 @@ void QIconView::invertSelection()
bool b = signalsBlocked(); bool b = signalsBlocked();
blockSignals( TRUE ); blockSignals( TRUE );
QIconViewItem *item = d->firstItem; QIconViewItem *item = d->firstItem;
for ( ; item; item = item->next ) for ( ; item; item = item->next ) {
item->setSelected( !item->isSelected(), TRUE ); if (item->isVisible()) {
item->setSelected( !item->isSelected(), TRUE );
}
else {
if ( FALSE != item->isSelected() ) {
item->setSelected( FALSE, TRUE );
}
}
}
blockSignals( b ); blockSignals( b );
emit selectionChanged(); emit selectionChanged();
} }

Loading…
Cancel
Save