Qt 4.8
Classes | Public Types | Public Functions | Static Public Functions | Private Types | Properties | List of all members
QSet< T > Class Template Reference

#include <qdatastream.h>

Classes

class  const_iterator
 
class  iterator
 

Public Types

typedef const value_typeconst_pointer
 
typedef const value_typeconst_reference
 
typedef const_iterator ConstIterator
 
typedef qptrdiff difference_type
 
typedef iterator Iterator
 
typedef T key_type
 
typedef value_typepointer
 
typedef value_typereference
 
typedef int size_type
 
typedef T value_type
 

Public Functions

iterator begin ()
 
const_iterator begin () const
 
int capacity () const
 
void clear ()
 
const_iterator constBegin () const
 
const_iterator constEnd () const
 
const_iterator constFind (const T &value) const
 
bool contains (const T &value) const
 
bool contains (const QSet< T > &set) const
 
int count () const
 
void detach ()
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
iterator erase (iterator i)
 
iterator find (const T &value)
 
const_iterator find (const T &value) const
 
const_iterator insert (const T &value)
 
QSet< T > & intersect (const QSet< T > &other)
 
bool isDetached () const
 
bool isEmpty () const
 
QSet< T > operator & (const QSet< T > &other) const
 
QSet< T > operator & (const QSet< T > &other)
 
QSet< T > & operator &= (const QSet< T > &other)
 
QSet< T > & operator &= (const T &value)
 
bool operator!= (const QSet< T > &other) const
 
QSet< T > operator+ (const QSet< T > &other) const
 
QSet< T > operator+ (const QSet< T > &other)
 
QSet< T > & operator+= (const QSet< T > &other)
 
QSet< T > & operator+= (const T &value)
 
QSet< T > operator- (const QSet< T > &other) const
 
QSet< T > operator- (const QSet< T > &other)
 
QSet< T > & operator-= (const QSet< T > &other)
 
QSet< T > & operator-= (const T &value)
 
QSet< T > & operator<< (const T &value)
 
QSet< T > & operator= (const QSet< T > &other)
 
bool operator== (const QSet< T > &other) const
 
QSet< T > operator| (const QSet< T > &other) const
 
QSet< T > operator| (const QSet< T > &other)
 
QSet< T > & operator|= (const QSet< T > &other)
 
QSet< T > & operator|= (const T &value)
 
 QSet ()
 
 QSet (const QSet< T > &other)
 
bool remove (const T &value)
 
void reserve (int size)
 
void setSharable (bool sharable)
 
int size () const
 
void squeeze ()
 
QSet< T > & subtract (const QSet< T > &other)
 
void swap (QSet< T > &other)
 
QList< T > toList () const
 
QSet< T > & unite (const QSet< T > &other)
 
QList< T > values () const
 

Static Public Functions

static QSet< T > fromList (const QList< T > &list)
 

Private Types

typedef QHash< T, QHashDummyValueHash
 

Properties

Hash q_hash
 

Detailed Description

template<class T>
class QSet< T >

Definition at line 65 of file qdatastream.h.

Typedefs

◆ const_pointer

template<class T>
typedef const value_type* QSet< T >::const_pointer

Definition at line 193 of file qset.h.

◆ const_reference

template<class T>
typedef const value_type& QSet< T >::const_reference

Definition at line 195 of file qset.h.

◆ ConstIterator

template<class T>
typedef const_iterator QSet< T >::ConstIterator

Definition at line 177 of file qset.h.

◆ difference_type

template<class T>
typedef qptrdiff QSet< T >::difference_type

Definition at line 196 of file qset.h.

◆ Hash

template<class T>
typedef QHash<T, QHashDummyValue> QSet< T >::Hash
private

Definition at line 56 of file qset.h.

◆ Iterator

template<class T>
typedef iterator QSet< T >::Iterator

Definition at line 176 of file qset.h.

◆ key_type

template<class T>
typedef T QSet< T >::key_type

Definition at line 190 of file qset.h.

◆ pointer

template<class T>
typedef value_type* QSet< T >::pointer

Definition at line 192 of file qset.h.

◆ reference

template<class T>
typedef value_type& QSet< T >::reference

Definition at line 194 of file qset.h.

◆ size_type

template<class T>
typedef int QSet< T >::size_type

Definition at line 197 of file qset.h.

◆ value_type

template<class T>
typedef T QSet< T >::value_type

Definition at line 191 of file qset.h.

Constructors and Destructors

◆ QSet() [1/2]

template<class T>
QSet< T >::QSet ( )
inline

Definition at line 59 of file qset.h.

59 {}

◆ QSet() [2/2]

template<class T>
QSet< T >::QSet ( const QSet< T > &  other)
inline

Definition at line 60 of file qset.h.

60 : q_hash(other.q_hash) {}
Hash q_hash
Definition: qset.h:237

Functions

◆ begin() [1/2]

template<class T>
iterator QSet< T >::begin ( )
inline

◆ begin() [2/2]

template<class T>
const_iterator QSet< T >::begin ( ) const
inline

Definition at line 167 of file qset.h.

167 { return q_hash.begin(); }
Hash q_hash
Definition: qset.h:237
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464

◆ capacity()

template<class T>
int QSet< T >::capacity ( ) const
inline

Definition at line 79 of file qset.h.

79 { return q_hash.capacity(); }
Hash q_hash
Definition: qset.h:237
int capacity() const
Returns the number of buckets in the QHash&#39;s internal hash table.
Definition: qhash.h:299

◆ clear()

template<class T>
void QSet< T >::clear ( )
inline

◆ constBegin()

template<class T>
const_iterator QSet< T >::constBegin ( ) const
inline

◆ constEnd()

template<class T>
const_iterator QSet< T >::constEnd ( ) const
inline

◆ constFind()

template<class T>
const_iterator QSet< T >::constFind ( const T &  value) const
inline

Definition at line 184 of file qset.h.

184 { return find(value); }
iterator find(const T &value)
Definition: qset.h:182

◆ contains() [1/2]

template<class T>
bool QSet< T >::contains ( const T &  value) const
inline

Definition at line 91 of file qset.h.

Referenced by QStateMachinePrivate::_q_animationFinished(), QSortFilterProxyModelPrivate::_q_sourceDataChanged(), QDeclarativeTypeLoader::absoluteFilePath(), QMenuPrivate::QMacMenuPrivate::addAction(), QPatternist::XsdIdCache::addId(), QPatternist::XsdSchemaParser::addType(), QStateMachinePrivate::applyProperties(), QPatternist::OutputValidator::attribute(), QGraphicsAnchorLayoutPrivate::calculateVertexPositions(), QDirIteratorPrivate::checkAndPushDirectory(), QDeclarativeCompiler::checkDynamicMeta(), QDeclarativeCompiler::checkValidId(), QGraphicsWidget::close(), QSet< typename TokenLookupClass::NodeName >::contains(), containsSet(), QWSServerPrivate::dereferenceFont(), QBBEngine::doRequestUpdate(), QListViewPrivate::draggablePaintPairs(), QStyleSheetStyle::drawPrimitive(), QResourcePrivate::ensureChildren(), QGraphicsScenePrivate::enterModal(), QApplicationPrivate::enterModal(), QStateMachinePrivate::enterStates(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::epsilonClosure(), QPatternist::ElementAvailableFN::evaluateEBV(), QJSDebuggerAgent::expandObjectById(), QSortFilterProxyModelPrivate::filter_changed(), QGestureManager::filterEventThroughContexts(), QGraphicsAnchorLayoutPrivate::findPaths(), QPatternist::XsdSchemaResolver::findPrimitiveType(), QPatternist::XsdSchemaHelper::foundSubstitutionGroupTransitive(), QGraphicsScenePrivate::gestureEventHandler(), QStateMachinePrivate::goToState(), QPatternist::XsdIdCache::hasId(), QDeclarativeImportsPrivate::importExtension(), QDeclarativeImportDatabase::importPlugin(), QSet< typename TokenLookupClass::NodeName >::intersect(), QScriptEdit::isExecutableLine(), QTreeViewPrivate::isIndexExpanded(), QStateMachinePrivate::isInFinalState(), QTreeViewPrivate::isRowHidden(), QHttpHeader::keys(), QApplicationPrivate::leaveModal(), QTextDocumentWithImageResources::loadResource(), matchesType(), QStandardItemModel::mimeData(), QPatternist::XQueryTokenizer::normalizeEOL(), QPatternist::ResourceDelegator::openDocument(), QSet< typename TokenLookupClass::NodeName >::operator&=(), QPatternist::XsdSchemaParser::parseAny(), QPatternist::XsdSchemaParser::parseAnyAttribute(), QPatternist::XsdSchemaParser::parseImport(), QPatternist::XsdSchemaParser::parseInclude(), QPatternist::XsdSchemaParser::parseRedefine(), QDeclarativeXmlQueryEngine::processQuery(), QtPrivate::QStringList_removeDuplicates(), QPatternist::XsdSchemaParser::readBlockingConstraintAttribute(), QPatternist::XsdSchemaParser::readDerivationConstraintAttribute(), MetaObjectGenerator::readEnumInfo(), QWSServerPrivate::referenceFont(), QEvent::registerEventType(), QGraphicsSceneBspTree::removeItems(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveAttributeTermReferences(), QPatternist::XsdSchemaResolver::resolveComplexContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleRestrictions(), QPatternist::XsdSchemaResolver::resolveTermReference(), QDomElementPrivate::save(), QItemSelectionModel::selectedColumns(), QTreeWidget::selectedItems(), QItemSelectionModel::selectedRows(), QJSDebuggerAgent::setProperty(), QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(), QGraphicsAnchorLayoutPrivate::simplifyVertices(), QFileSystemEngine::slowCanonicalized(), QTreeViewPrivate::storeExpanded(), QFontEngineQPA::stringToCMap(), QFontEngineQPF::stringToCMap(), QPatternist::XsdSchemaHelper::substitutionGroupOkTransitive(), QSet< typename TokenLookupClass::NodeName >::subtract(), QDeclarativeSmoothedAnimation::transition(), QStyleSheetStyle::unsetPalette(), QPatternist::XsdValidatingInstanceReader::validate(), QPatternist::MaintainingReader< XSLTTokenLookup >::validateElement(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), QScriptEnginePrivate::variantListFromArray(), QScriptEnginePrivate::variantMapFromObject(), QPatternist::XsdSchemaHelper::wildcardUnion(), wxsTypeMatches(), and QPatternist::yyparse().

91 { return q_hash.contains(value); }
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
Hash q_hash
Definition: qset.h:237

◆ contains() [2/2]

template<class T>
Q_INLINE_TEMPLATE bool QSet< T >::contains ( const QSet< T > &  set) const

Definition at line 284 of file qset.h.

285 {
286  typename QSet<T>::const_iterator i = other.constBegin();
287  while (i != other.constEnd()) {
288  if (!contains(*i))
289  return false;
290  ++i;
291  }
292  return true;
293 }
bool contains(const T &value) const
Definition: qset.h:91

◆ count()

template<class T>
int QSet< T >::count ( ) const
inline

◆ detach()

template<class T>
void QSet< T >::detach ( )
inline

Definition at line 83 of file qset.h.

83 { q_hash.detach(); }
Hash q_hash
Definition: qset.h:237
void detach()
Detaches this hash from any other hashes with which it may share data.
Definition: qhash.h:303

◆ empty()

template<class T>
bool QSet< T >::empty ( ) const
inline

Definition at line 199 of file qset.h.

199 { return isEmpty(); }
bool isEmpty() const
Definition: qset.h:77

◆ end() [1/2]

template<class T>
iterator QSet< T >::end ( )
inline

◆ end() [2/2]

template<class T>
const_iterator QSet< T >::end ( ) const
inline

Definition at line 170 of file qset.h.

170 { return q_hash.end(); }
Hash q_hash
Definition: qset.h:237
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467

◆ erase()

template<class T>
iterator QSet< T >::erase ( iterator  i)
inline

Definition at line 172 of file qset.h.

Referenced by QGestureManager::cancelGesturesForChildren(), QGraphicsScenePrivate::cancelGesturesForChildren(), QStandardItemModel::mimeData(), and QMutableSetIterator< T >::remove().

173  { return q_hash.erase(reinterpret_cast<typename Hash::iterator &>(i)); }
Hash q_hash
Definition: qset.h:237
iterator erase(iterator it)
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator...
Definition: qhash.h:827

◆ find() [1/2]

template<class T>
iterator QSet< T >::find ( const T &  value)
inline

Definition at line 182 of file qset.h.

Referenced by QSet< typename TokenLookupClass::NodeName >::constFind(), and QStandardItemModel::mimeData().

182 { return q_hash.find(value); }
Hash q_hash
Definition: qset.h:237
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:865

◆ find() [2/2]

template<class T>
const_iterator QSet< T >::find ( const T &  value) const
inline

Definition at line 183 of file qset.h.

183 { return q_hash.find(value); }
Hash q_hash
Definition: qset.h:237
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:865

◆ fromList()

template<typename T>
QSet< T > QSet< T >::fromList ( const QList< T > &  list)
static

Definition at line 319 of file qset.h.

Referenced by QGraphicsAnchorLayoutPrivate::getGraphParts(), main(), and QSet< typename TokenLookupClass::NodeName >::values().

320 {
321  return list.toSet();
322 }
QSet< T > toSet() const
Returns a QSet object with the data contained in this QList.
Definition: qset.h:309

◆ insert()

template<class T>
const_iterator QSet< T >::insert ( const T &  value)
inline

Definition at line 179 of file qset.h.

Referenced by QDeclarativeXmlQueryEngine::abort(), QMenuPrivate::QMacMenuPrivate::addAction(), QPatternist::XsdIdCache::addId(), QStateMachinePrivate::addStatesToEnter(), QPatternist::ElementAvailableFN::allXSLTInstructions(), QStateMachinePrivate::applyProperties(), QPatternist::OutputValidator::attribute(), QDeclarativePath::attributes(), QGraphicsAnchorLayoutPrivate::calculateVertexPositions(), QScriptObjectSnapshot::capture(), QDeclarativeCompiler::checkDynamicMeta(), QGestureManager::cleanupCachedGestures(), collectAllElements(), QDeclarativePath::componentComplete(), QNetworkConfigurationManagerPrivate::configurationAdded(), QNetworkConfigurationManagerPrivate::configurationChanged(), QPatternist::XSLTTokenizer::createElementDescriptions(), QPatternist::XSLTTokenizer::createStandardAttributes(), QGestureManager::deliverEvents(), dlIterateCallback(), QResourcePrivate::ensureChildren(), QGraphicsScenePrivate::enterModal(), QApplicationPrivate::enterModal(), QStateMachinePrivate::enterStates(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::epsilonClosure(), QScriptDebuggerCommandExecutor::execute(), QStateMachinePrivate::exitStates(), QGraphicsAnchorLayoutPrivate::findPaths(), QPatternist::XsdSchemaResolver::findPrimitiveType(), QPatternist::XsdSchemaHelper::foundSubstitutionGroupTransitive(), QPatternist::XsdSchemaHelper::foundSubstitutionGroupTypeInheritance(), QGraphicsScenePrivate::gestureEventHandler(), QGraphicsAnchorLayoutPrivate::identifyFloatItems(), QGraphicsAnchorLayoutPrivate::identifyNonFloatItems_helper(), QDeclarativeImportsPrivate::importExtension(), QDeclarativeImportDatabase::importPlugin(), QHttpHeader::keys(), QApplicationPrivate::leaveModal(), QTextDocumentWithImageResources::loadResource(), ShaderEffectItem::lookThroughShaderCode(), QMacPixmapData::macCreateCGImageRef(), matchesType(), QStandardItemModel::mimeData(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::move(), QPatternist::XQueryTokenizer::nextToken(), QSet< typename TokenLookupClass::NodeName >::operator&=(), QSet< typename TokenLookupClass::NodeName >::operator+=(), QSet< typename TokenLookupClass::NodeName >::operator<<(), QSet< typename TokenLookupClass::NodeName >::operator|=(), QPatternist::XsdSchemaParser::parseImport(), QPatternist::XsdSchemaParser::parseInclude(), QPatternist::XsdSchemaParser::parseRedefine(), QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate(), QStyleSheetStyle::polish(), QNetworkConfigurationManagerPrivate::pollEngines(), QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(), QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(), qmlFilesInDirectory(), QtPrivate::QStringList_removeDuplicates(), QPatternist::XsdSchemaParser::readBlockingConstraintAttribute(), QPatternist::XsdSchemaParser::readDerivationConstraintAttribute(), MetaObjectGenerator::readEnumInfo(), QWSServerPrivate::referenceFont(), QEvent::registerEventType(), QGraphicsScenePrivate::registerScenePosItem(), QWidgetBackingStoreTracker::registerWidget(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveAttributeTermReferences(), QPatternist::XsdSchemaResolver::resolveComplexContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleRestrictions(), QPatternist::XsdSchemaResolver::resolveTermReference(), QDomElementPrivate::save(), QTreeWidget::selectedItems(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QStateMachinePrivate::selectTransitions(), QPatternist::XsdSchemaParser::setDocumentURI(), QPatternist::XsdSchemaParser::setupBuiltinTypeNames(), QPatternist::XsdSchemaParserContext::setupElementDescriptions(), QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(), QGraphicsAnchorLayoutPrivate::simplifyVertices(), QFileSystemEngine::slowCanonicalized(), QThreadPoolPrivate::startThread(), QTreeViewPrivate::storeExpanded(), QFontEngineQPA::stringToCMap(), QFontEngineQPF::stringToCMap(), QDeclarativeBindingCompilerPrivate::subscription(), QSslSocketPrivate::systemCaCertificates(), QPatternist::XQueryTokenizer::tokenizeStringLiteral(), QList< QPostEvent >::toSet(), QDeclarativeSmoothedAnimation::transition(), QSet< typename TokenLookupClass::NodeName >::unite(), QDockAreaLayoutInfo::usedTabBars(), QPatternist::XsdValidatingInstanceReader::validate(), QPatternist::XsdValidatingInstanceReader::validateAttribute(), QPatternist::MaintainingReader< XSLTTokenLookup >::validateElement(), QPatternist::XsdValidatingInstanceReader::validateElementSimpleType(), QScriptEnginePrivate::variantListFromArray(), QScriptEnginePrivate::variantMapFromObject(), Graph< AnchorVertex, AnchorData >::vertices(), wxsTypeMatches(), and QPatternist::yyparse().

180  { return static_cast<typename Hash::const_iterator>(q_hash.insert(value,
181  QHashDummyValue())); }
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
Hash q_hash
Definition: qset.h:237
friend class const_iterator
Definition: qhash.h:461

◆ intersect()

template<class T>
Q_INLINE_TEMPLATE QSet< T > & QSet< T >::intersect ( const QSet< T > &  other)

Definition at line 256 of file qset.h.

Referenced by QSet< typename TokenLookupClass::NodeName >::constFind(), QSet< typename TokenLookupClass::NodeName >::operator&=(), QPatternist::XsdSchemaParser::readBlockingConstraintAttribute(), QPatternist::XsdSchemaParser::readDerivationConstraintAttribute(), and QPatternist::XsdSchemaHelper::wildcardIntersection().

257 {
258  QSet<T> copy1(*this);
259  QSet<T> copy2(other);
260  typename QSet<T>::const_iterator i = copy1.constEnd();
261  while (i != copy1.constBegin()) {
262  --i;
263  if (!copy2.contains(*i))
264  remove(*i);
265  }
266  return *this;
267 }

◆ isDetached()

template<class T>
bool QSet< T >::isDetached ( ) const
inline

Definition at line 84 of file qset.h.

84 { return q_hash.isDetached(); }
bool isDetached() const
Returns true if the hash&#39;s internal data isn&#39;t shared with any other hash object; otherwise returns f...
Definition: qhash.h:304
Hash q_hash
Definition: qset.h:237

◆ isEmpty()

template<class T>
bool QSet< T >::isEmpty ( ) const
inline

◆ operator &() [1/2]

template<class T>
QSet<T> QSet< T >::operator& ( const QSet< T > &  other) const
inline

Definition at line 213 of file qset.h.

214  { QSet<T> result = *this; result &= other; return result; }

◆ operator &() [2/2]

template<class T>
QSet<T> QSet< T >::operator& ( const QSet< T > &  other)
inline

Definition at line 223 of file qset.h.

224  { QSet<T> result = *this; result &= other; return result; }

◆ operator &=() [1/2]

template<class T>
QSet<T>& QSet< T >::operator&= ( const QSet< T > &  other)
inline

Definition at line 204 of file qset.h.

204 { intersect(other); return *this; }
QSet< T > & intersect(const QSet< T > &other)
Definition: qset.h:256

◆ operator &=() [2/2]

template<class T>
QSet<T>& QSet< T >::operator&= ( const T &  value)
inline

Definition at line 205 of file qset.h.

206  { QSet<T> result; if (contains(value)) result.insert(value); return (*this = result); }
bool contains(const T &value) const
Definition: qset.h:91
const_iterator insert(const T &value)
Definition: qset.h:179

◆ operator!=()

template<class T>
bool QSet< T >::operator!= ( const QSet< T > &  other) const
inline

Definition at line 72 of file qset.h.

73  { return q_hash != other.q_hash; }
Hash q_hash
Definition: qset.h:237

◆ operator+() [1/2]

template<class T>
QSet<T> QSet< T >::operator+ ( const QSet< T > &  other) const
inline

Definition at line 215 of file qset.h.

216  { QSet<T> result = *this; result += other; return result; }

◆ operator+() [2/2]

template<class T>
QSet<T> QSet< T >::operator+ ( const QSet< T > &  other)
inline

Definition at line 225 of file qset.h.

226  { QSet<T> result = *this; result += other; return result; }

◆ operator+=() [1/2]

template<class T>
QSet<T>& QSet< T >::operator+= ( const QSet< T > &  other)
inline

Definition at line 207 of file qset.h.

207 { unite(other); return *this; }
QSet< T > & unite(const QSet< T > &other)
Definition: qset.h:244

◆ operator+=() [2/2]

template<class T>
QSet<T>& QSet< T >::operator+= ( const T &  value)
inline

Definition at line 208 of file qset.h.

208 { insert(value); return *this; }
const_iterator insert(const T &value)
Definition: qset.h:179

◆ operator-() [1/2]

template<class T>
QSet<T> QSet< T >::operator- ( const QSet< T > &  other) const
inline

Definition at line 217 of file qset.h.

218  { QSet<T> result = *this; result -= other; return result; }

◆ operator-() [2/2]

template<class T>
QSet<T> QSet< T >::operator- ( const QSet< T > &  other)
inline

Definition at line 227 of file qset.h.

228  { QSet<T> result = *this; result -= other; return result; }

◆ operator-=() [1/2]

template<class T>
QSet<T>& QSet< T >::operator-= ( const QSet< T > &  other)
inline

Definition at line 209 of file qset.h.

209 { subtract(other); return *this; }
QSet< T > & subtract(const QSet< T > &other)
Definition: qset.h:270

◆ operator-=() [2/2]

template<class T>
QSet<T>& QSet< T >::operator-= ( const T &  value)
inline

Definition at line 210 of file qset.h.

210 { remove(value); return *this; }

◆ operator<<()

template<class T>
QSet<T>& QSet< T >::operator<< ( const T &  value)
inline

Definition at line 201 of file qset.h.

201 { insert(value); return *this; }
const_iterator insert(const T &value)
Definition: qset.h:179

◆ operator=()

template<class T>
QSet<T>& QSet< T >::operator= ( const QSet< T > &  other)
inline

Definition at line 62 of file qset.h.

Referenced by QSet< typename TokenLookupClass::NodeName >::operator=().

63  { q_hash = other.q_hash; return *this; }
Hash q_hash
Definition: qset.h:237

◆ operator==()

template<class T>
bool QSet< T >::operator== ( const QSet< T > &  other) const
inline

Definition at line 70 of file qset.h.

71  { return q_hash == other.q_hash; }
Hash q_hash
Definition: qset.h:237

◆ operator|() [1/2]

template<class T>
QSet<T> QSet< T >::operator| ( const QSet< T > &  other) const
inline

Definition at line 211 of file qset.h.

212  { QSet<T> result = *this; result |= other; return result; }

◆ operator|() [2/2]

template<class T>
QSet<T> QSet< T >::operator| ( const QSet< T > &  other)
inline

Definition at line 221 of file qset.h.

222  { QSet<T> result = *this; result |= other; return result; }

◆ operator|=() [1/2]

template<class T>
QSet<T>& QSet< T >::operator|= ( const QSet< T > &  other)
inline

Definition at line 202 of file qset.h.

202 { unite(other); return *this; }
QSet< T > & unite(const QSet< T > &other)
Definition: qset.h:244

◆ operator|=() [2/2]

template<class T>
QSet<T>& QSet< T >::operator|= ( const T &  value)
inline

Definition at line 203 of file qset.h.

203 { insert(value); return *this; }
const_iterator insert(const T &value)
Definition: qset.h:179

◆ remove()

template<class T>
bool QSet< T >::remove ( const T &  value)
inline

Definition at line 89 of file qset.h.

Referenced by QStateMachinePrivate::_q_animationFinished(), QStateMachinePrivate::applyProperties(), QGraphicsScenePrivate::cancelGesturesForChildren(), QWidgetExceptionCleaner::cleanup(), QGestureManager::cleanupCachedGestures(), QX11Data::clipboardReadIncrementalProperty(), QNetworkConfigurationManagerPrivate::configurationChanged(), QNetworkConfigurationManagerPrivate::configurationRemoved(), QWSServerPrivate::dereferenceFont(), QTableViewPrivate::drawAndClipSpans(), QStateMachinePrivate::exitStates(), QGraphicsScenePrivate::gestureEventHandler(), QDeclarativeXmlQueryEngine::processJobs(), QDeclarativeXmlQueryEngine::processQuery(), QClipboardData::QClipboardData(), qt_tablet_init(), QGestureManager::recycle(), QGraphicsScenePrivate::removeItemHelper(), QGraphicsScene::setSelectionArea(), setupOwner(), QGLGlobalShareWidget::shareWidget(), QGraphicsScenePrivate::unregisterScenePosItem(), QWidgetBackingStoreTracker::unregisterWidget(), QStyleSheetStyle::unsetPalette(), QNetworkConfigurationManagerPrivate::updateConfigurations(), QScriptEnginePrivate::variantListFromArray(), QScriptEnginePrivate::variantMapFromObject(), QPatternist::XsdSchemaHelper::wildcardIntersection(), QWindowsXPStylePrivate::winId(), QDeclarativeOpenMetaObject::~QDeclarativeOpenMetaObject(), QMacPixmapData::~QMacPixmapData(), and QWidget::~QWidget().

89 { return q_hash.remove(value) != 0; }
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
Hash q_hash
Definition: qset.h:237

◆ reserve()

template<class T >
Q_INLINE_TEMPLATE void QSet< T >::reserve ( int  size)
inline

◆ setSharable()

template<class T>
void QSet< T >::setSharable ( bool  sharable)
inline

Definition at line 85 of file qset.h.

Referenced by QMutableSetIterator< T >::operator=(), QMutableSetIterator< T >::QMutableSetIterator(), and QMutableSetIterator< T >::~QMutableSetIterator().

85 { q_hash.setSharable(sharable); }
void setSharable(bool sharable)
Definition: qhash.h:305
Hash q_hash
Definition: qset.h:237

◆ size()

template<class T>
int QSet< T >::size ( ) const
inline

◆ squeeze()

template<class T>
void QSet< T >::squeeze ( )
inline

Definition at line 81 of file qset.h.

81 { q_hash.squeeze(); }
void squeeze()
Reduces the size of the QHash&#39;s internal hash table to save memory.
Definition: qhash.h:301
Hash q_hash
Definition: qset.h:237

◆ subtract()

template<class T>
Q_INLINE_TEMPLATE QSet< T > & QSet< T >::subtract ( const QSet< T > &  other)

◆ swap()

template<class T>
void QSet< T >::swap ( QSet< T > &  other)
inline

Definition at line 68 of file qset.h.

68 { q_hash.swap(other.q_hash); }
void swap(QHash< Key, T > &other)
Swaps hash other with this hash.
Definition: qhash.h:290
Hash q_hash
Definition: qset.h:237

◆ toList()

template<typename T >
Q_OUTOFLINE_TEMPLATE QList< T > QSet< T >::toList ( ) const

Definition at line 296 of file qset.h.

Referenced by QStateMachinePrivate::_q_process(), QApplication::allWidgets(), QDeclarativePath::attributes(), QScriptEngine::availableExtensions(), QGraphicsAnchorLayoutPrivate::calculateTrunk(), QGraphicsScenePrivate::cancelGesturesForChildren(), QScriptObjectSnapshot::capture(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QDeclarativePath::componentComplete(), QListViewPrivate::draggablePaintPairs(), QStateMachinePrivate::enterStates(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::epsilonClosure(), QScriptDebuggerCommandExecutor::execute(), QStateMachinePrivate::exitStates(), QGraphicsScenePrivate::gestureEventHandler(), getVariables(), libraryPathList(), QSet< typename TokenLookupClass::NodeName >::operator-(), QPatternist::XsdSchemaParser::parseAny(), QPatternist::XsdSchemaParser::parseAnyAttribute(), QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(), QScriptDebuggerAgent::scriptsDelta(), QSimplex::setConstraints(), QSpanCollection::spansInRect(), QPatternist::MaintainingReader< XSLTTokenLookup >::validateElement(), QSet< typename TokenLookupClass::NodeName >::values(), and QTextOdfWriter::writeAll().

297 {
298  QList<T> result;
299  result.reserve(size());
300  typename QSet<T>::const_iterator i = constBegin();
301  while (i != constEnd()) {
302  result.append(*i);
303  ++i;
304  }
305  return result;
306 }
const_iterator constEnd() const
Definition: qset.h:171
int size() const
Definition: qset.h:75
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const_iterator constBegin() const
Definition: qset.h:168
void reserve(int size)
Reserve space for alloc elements.
Definition: qlist.h:496
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ unite()

template<class T>
Q_INLINE_TEMPLATE QSet< T > & QSet< T >::unite ( const QSet< T > &  other)

Definition at line 244 of file qset.h.

Referenced by collectAllElements(), QSet< typename TokenLookupClass::NodeName >::constFind(), QDeclarativeBindingCompilerPrivate::numberArith(), QSet< typename TokenLookupClass::NodeName >::operator+=(), QSet< typename TokenLookupClass::NodeName >::operator|=(), and QDeclarativeBindingCompilerPrivate::subscriptionNeutral().

245 {
246  QSet<T> copy(other);
247  typename QSet<T>::const_iterator i = copy.constEnd();
248  while (i != copy.constBegin()) {
249  --i;
250  insert(*i);
251  }
252  return *this;
253 }
const_iterator insert(const T &value)
Definition: qset.h:179

◆ values()

template<class T>
QList<T> QSet< T >::values ( ) const
inline

Properties

◆ q_hash

template<class T>
Hash QSet< T >::q_hash
private

The documentation for this class was generated from the following files: