diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2017-07-02 15:28:40 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2017-07-02 15:28:52 +0200 |
commit | ad6af17aea071680cf35c06846fab6fb8f885a44 (patch) | |
tree | 2c4d56e6d9fa1d3823ee6ee92f27c7a313d88659 | |
parent | 47690cd1412fc3cb21cf3d2b82e9f8bddebc99a7 (diff) | |
download | qt3-ad6af17aea071680cf35c06846fab6fb8f885a44.tar.gz qt3-ad6af17aea071680cf35c06846fab6fb8f885a44.zip |
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 057d9fe7a490371b8f2914992ef5c9fcae9720a7)
-rw-r--r-- | src/iconview/qiconview.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/iconview/qiconview.cpp b/src/iconview/qiconview.cpp index 2eb7b71..b838427 100644 --- a/src/iconview/qiconview.cpp +++ b/src/iconview/qiconview.cpp @@ -3872,11 +3872,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; } } } @@ -3906,8 +3906,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(); } |