From 523c1fd99e9ba466064edfc235104ec5190e5ca3 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 22 Dec 2013 03:18:11 -0600 Subject: Automated update from Qt3 --- src/tools/ntqvaluelist.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/tools') diff --git a/src/tools/ntqvaluelist.h b/src/tools/ntqvaluelist.h index 91d50c942..fd14437b5 100644 --- a/src/tools/ntqvaluelist.h +++ b/src/tools/ntqvaluelist.h @@ -250,6 +250,7 @@ public: NodePtr find( NodePtr start, const T& x ) const; int findIndex( NodePtr start, const T& x ) const; uint contains( const T& x ) const; + bool containsYesNo( const T& x ) const; uint remove( const T& x ); NodePtr at( size_type i ) const; void clear(); @@ -354,6 +355,19 @@ Q_INLINE_TEMPLATES uint TQValueListPrivate::contains( const T& x ) const return result; } +template +Q_INLINE_TEMPLATES bool TQValueListPrivate::containsYesNo( const T& x ) const +{ + Iterator first = Iterator( node->next ); + Iterator last = Iterator( node ); + while( first != last) { + if ( *first == x ) + return true; + ++first; + } + return false; +} + template Q_INLINE_TEMPLATES uint TQValueListPrivate::remove( const T& _x ) { @@ -547,6 +561,7 @@ public: const_iterator find ( const_iterator it, const T& x ) const { return const_iterator( sh->find( it.node, x ) ); } int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; } size_type contains( const T& x ) const { return sh->contains( x ); } + bool containsYesNo( const T& x ) const { return sh->containsYesNo( x ); } size_type count() const { return sh->nodes; } -- cgit v1.2.1