diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2017-07-02 15:37:41 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2017-07-02 15:37:59 +0200 |
commit | 6d597bf69f8278bae2f88ad448fb31be4c130527 (patch) | |
tree | 865256a454e6bc797d0de45557125a203126dbb5 /src/widgets/qlistview.cpp | |
parent | bcd361a8207843d17ae08180a8ec3446e8de888f (diff) | |
download | tqt3-6d597bf69f8278bae2f88ad448fb31be4c130527.tar.gz tqt3-6d597bf69f8278bae2f88ad448fb31be4c130527.zip |
ListView: Deselect items that are hidden by the filter
during selectAll and invertSelection
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 2af0620bfcb7547a7786ac2ee209e0dd6e39ec60)
Diffstat (limited to 'src/widgets/qlistview.cpp')
-rw-r--r-- | src/widgets/qlistview.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/widgets/qlistview.cpp b/src/widgets/qlistview.cpp index 79d338120..b0b8e96d8 100644 --- a/src/widgets/qlistview.cpp +++ b/src/widgets/qlistview.cpp @@ -5366,9 +5366,17 @@ void TQListView::selectAll( bool select ) TQListViewItemIterator it( this ); while ( it.current() ) { TQListViewItem *i = it.current(); - if ( (bool)i->selected != select ) { - i->setSelected( select ); - anything = TRUE; + if ( i->isVisible()) { + if ( (bool)i->selected != select ) { + i->setSelected( select ); + anything = TRUE; + } + } + else { + if ( (bool)i->selected != FALSE ) { + i->setSelected( FALSE ); + anything = TRUE; + } } ++it; } @@ -5398,8 +5406,16 @@ void TQListView::invertSelection() bool b = signalsBlocked(); blockSignals( TRUE ); TQListViewItemIterator it( this ); - for ( ; it.current(); ++it ) - it.current()->setSelected( !it.current()->isSelected() ); + for ( ; it.current(); ++it ) { + if (it.current()->isVisible()) { + it.current()->setSelected( !it.current()->isSelected() ); + } + else { + if ( FALSE != it.current()->isSelected() ) { + it.current()->setSelected( FALSE ); + } + } + } blockSignals( b ); emit selectionChanged(); triggerUpdate(); |