diff --git a/src/iconview/qiconview.cpp b/src/iconview/qiconview.cpp index 1326204..1493ead 100644 --- a/src/iconview/qiconview.cpp +++ b/src/iconview/qiconview.cpp @@ -3867,11 +3867,11 @@ void QIconView::selectAll( bool select ) rr = rr.unite( item->rect() ); changed = TRUE; } - else { - if ( FALSE != item->isSelected() ) { - item->setSelected( FALSE, TRUE ); - changed = TRUE; - } + } + else { + if ( FALSE != item->isSelected() ) { + item->setSelected( FALSE, TRUE ); + changed = TRUE; } } } @@ -3901,8 +3901,16 @@ void QIconView::invertSelection() bool b = signalsBlocked(); blockSignals( TRUE ); QIconViewItem *item = d->firstItem; - for ( ; item; item = item->next ) - item->setSelected( !item->isSelected(), TRUE ); + for ( ; item; item = item->next ) { + if (item->isVisible()) { + item->setSelected( !item->isSelected(), TRUE ); + } + else { + if ( FALSE != item->isSelected() ) { + item->setSelected( FALSE, TRUE ); + } + } + } blockSignals( b ); emit selectionChanged(); }