summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-07-02 13:28:40 (GMT)
committer Slávek Banko <slavek.banko@axis.cz>2017-07-02 13:28:40 (GMT)
commit057d9fe7a490371b8f2914992ef5c9fcae9720a7 (patch)
tree3abec05b682347d70b62022d9f0547fd60951112
parente70f5ecf7693b63d3221c590ae05414307515451 (diff)
downloadqt3-057d9fe7.zip
qt3-057d9fe7.tar.gz
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>
-rw-r--r--src/widgets/qiconview.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/widgets/qiconview.cpp b/src/widgets/qiconview.cpp
index e2a00bb..5dd2091 100644
--- a/src/widgets/qiconview.cpp
+++ b/src/widgets/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();
}