Qt 4.8
|
The QHash class is a template class that provides a hash-table-based dictionary. More...
#include <qdatastream.h>
Classes | |
class | const_iterator |
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash. More... | |
class | iterator |
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash. More... | |
Public Types | |
typedef const_iterator | ConstIterator |
Qt-style synonym for QHash::const_iterator. More... | |
typedef qptrdiff | difference_type |
Typedef for ptrdiff_t. More... | |
typedef iterator | Iterator |
Qt-style synonym for QHash::iterator. More... | |
typedef Key | key_type |
Typedef for Key. More... | |
typedef T | mapped_type |
Typedef for T. More... | |
typedef int | size_type |
Typedef for int. More... | |
Public Functions | |
iterator | begin () |
Returns an STL-style iterator pointing to the first item in the hash. More... | |
const_iterator | begin () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
int | capacity () const |
Returns the number of buckets in the QHash's internal hash table. More... | |
void | clear () |
Removes all items from the hash. More... | |
const_iterator | constBegin () const |
Returns a const STL-style iterator pointing to the first item in the hash. More... | |
const_iterator | constEnd () const |
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash. More... | |
const_iterator | constFind (const Key &key) const |
Returns an iterator pointing to the item with the key in the hash. More... | |
bool | contains (const Key &key) const |
Returns true if the hash contains an item with the key; otherwise returns false. More... | |
int | count (const Key &key) const |
Returns the number of items associated with the key. More... | |
int | count () const |
Same as size(). More... | |
void | detach () |
Detaches this hash from any other hashes with which it may share data. More... | |
bool | empty () const |
This function is provided for STL compatibility. More... | |
iterator | end () |
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash. More... | |
const_iterator | end () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
iterator | erase (iterator it) |
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator to the next item in the hash. More... | |
iterator | find (const Key &key) |
Returns an iterator pointing to the item with the key in the hash. More... | |
const_iterator | find (const Key &key) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
iterator | insert (const Key &key, const T &value) |
Inserts a new item with the key and a value of value. More... | |
iterator | insertMulti (const Key &key, const T &value) |
Inserts a new item with the key and a value of value. More... | |
bool | isDetached () const |
Returns true if the hash's internal data isn't shared with any other hash object; otherwise returns false. More... | |
bool | isEmpty () const |
Returns true if the hash contains no items; otherwise returns false. More... | |
bool | isSharedWith (const QHash< Key, T > &other) const |
const Key | key (const T &value) const |
Returns the first key mapped to value. More... | |
const Key | key (const T &value, const Key &defaultKey) const |
Returns the first key mapped to value, or defaultKey if the hash contains no item mapped to value. More... | |
QList< Key > | keys () const |
Returns a list containing all the keys in the hash, in an arbitrary order. More... | |
QList< Key > | keys (const T &value) const |
Returns a list containing all the keys associated with value value, in an arbitrary order. More... | |
bool | operator!= (const QHash< Key, T > &other) const |
Returns true if other is not equal to this hash; otherwise returns false. More... | |
QHash< Key, T > & | operator= (const QHash< Key, T > &other) |
Assigns other to this hash and returns a reference to this hash. More... | |
bool | operator== (const QHash< Key, T > &other) const |
Returns true if other is equal to this hash; otherwise returns false. More... | |
T & | operator[] (const Key &key) |
Returns the value associated with the key as a modifiable reference. More... | |
const T | operator[] (const Key &key) const |
Same as value(). More... | |
QHash () | |
Constructs an empty hash. More... | |
QHash (const QHash< Key, T > &other) | |
Constructs a copy of other. More... | |
int | remove (const Key &key) |
Removes all the items that have the key from the hash. More... | |
void | reserve (int size) |
Ensures that the QHash's internal hash table consists of at least size buckets. More... | |
void | setSharable (bool sharable) |
int | size () const |
Returns the number of items in the hash. More... | |
void | squeeze () |
Reduces the size of the QHash's internal hash table to save memory. More... | |
void | swap (QHash< Key, T > &other) |
Swaps hash other with this hash. More... | |
T | take (const Key &key) |
Removes the item with the key from the hash and returns the value associated with it. More... | |
QList< Key > | uniqueKeys () const |
Returns a list containing all the keys in the map. More... | |
QHash< Key, T > & | unite (const QHash< Key, T > &other) |
Inserts all the items in the other hash into this hash. More... | |
const T | value (const Key &key) const |
Returns the value associated with the key. More... | |
const T | value (const Key &key, const T &defaultValue) const |
If the hash contains no item with the given key, the function returns defaultValue. More... | |
QList< T > | values () const |
Returns a list containing all the values in the hash, in an arbitrary order. More... | |
QList< T > | values (const Key &key) const |
Returns a list of all the values associated with the key, from the most recently inserted to the least recently inserted. More... | |
~QHash () | |
Destroys the hash. More... | |
Private Types | |
typedef QHashDummyNode< Key, T > | DummyNode |
typedef QHashNode< Key, T > | Node |
Private Functions | |
Node * | createNode (uint h, const Key &key, const T &value, Node **nextNode) |
void | deleteNode (Node *node) |
void | detach_helper () |
Node ** | findNode (const Key &key, uint *hp=0) const |
void | freeData (QHashData *d) |
Static Private Functions | |
static int | alignOfDummyNode () |
static int | alignOfNode () |
static Node * | concrete (QHashData::Node *node) |
static void | deleteNode2 (QHashData::Node *node) |
static void | duplicateNode (QHashData::Node *originalNode, void *newNode) |
Properties | |
union { | |
QHashData * d | |
QHashNode< Key, T > * e | |
}; | |
Friends | |
class | const_iterator |
class | iterator |
Related Functions | |
(Note that these are not member functions.) | |
QDataStream & | operator<< (QDataStream &out, const QHash< Key, T > &hash) |
Writes the hash hash to stream out. More... | |
QDataStream & | operator>> (QDataStream &in, QHash< Key, T > &hash) |
Reads a hash from stream in into hash. More... | |
uint | qHash (const QPair< T1, T2 > &key) |
Returns the hash value for the key. More... | |
uint | qHash (char key) |
Returns the hash value for the key. More... | |
uint | qHash (uchar key) |
Returns the hash value for the key. More... | |
uint | qHash (signed char key) |
Returns the hash value for the key. More... | |
uint | qHash (ushort key) |
Returns the hash value for the key. More... | |
uint | qHash (short key) |
Returns the hash value for the key. More... | |
uint | qHash (uint key) |
Returns the hash value for the key. More... | |
uint | qHash (int key) |
Returns the hash value for the key. More... | |
uint | qHash (ulong key) |
Returns the hash value for the key. More... | |
uint | qHash (long key) |
Returns the hash value for the key. More... | |
uint | qHash (quint64 key) |
Returns the hash value for the key. More... | |
uint | qHash (qint64 key) |
Returns the hash value for the key. More... | |
uint | qHash (QChar key) |
Returns the hash value for the key. More... | |
uint | qHash (const QBitArray &key) |
uint | qHash (const QString &key) |
Returns the hash value for the key. More... | |
uint | qHash (const T *key) |
uint | qHash (const QXmlNodeModelIndex &index) |
Computes a hash key from the QXmlNodeModelIndex index, and returns it. More... | |
The QHash class is a template class that provides a hash-table-based dictionary.
QHash<Key, T> is one of Qt's generic container classes. It stores (key, value) pairs and provides very fast lookup of the value associated with a key.
QHash provides very similar functionality to QMap. The differences are:
Here's an example QHash with QString keys and int
values:
To insert a (key, value) pair into the hash, you can use operator[]():
This inserts the following three (key, value) pairs into the QHash: ("one", 1), ("three", 3), and ("seven", 7). Another way to insert items into the hash is to use insert():
To look up a value, use operator[]() or value():
If there is no item with the specified key in the hash, these functions return a default-constructed value.
If you want to check whether the hash contains a particular key, use contains():
There is also a value() overload that uses its second argument as a default value if there is no item with the specified key:
In general, we recommend that you use contains() and value() rather than operator[]() for looking up a key in a hash. The reason is that operator[]() silently inserts an item into the hash if no item exists with the same key (unless the hash is const). For example, the following code snippet will create 1000 items in memory:
To avoid this problem, replace hash
[i] with hash.value(i)
in the code above.
If you want to navigate through all the (key, value) pairs stored in a QHash, you can use an iterator. QHash provides both Java-style iterators (QHashIterator and QMutableHashIterator) and STL-style iterators (QHash::const_iterator and QHash::iterator). Here's how to iterate over a QHash<QString, int> using a Java-style iterator:
Here's the same code, but using an STL-style iterator:
QHash is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap.
Normally, a QHash allows only one value per key. If you call insert() with a key that already exists in the QHash, the previous value is erased. For example:
However, you can store multiple values per key by using insertMulti() instead of insert() (or using the convenience subclass QMultiHash). If you want to retrieve all the values for a single key, you can use values(const Key &key), which returns a QList<T>:
The items that share the same key are available from most recently to least recently inserted. A more efficient approach is to call find() to get the iterator for the first item with a key and iterate from there:
If you only need to extract the values from a hash (not the keys), you can also use foreach:
Items can be removed from the hash in several ways. One way is to call remove(); this will remove any item with the given key. Another way is to use QMutableHashIterator::remove(). In addition, you can clear the entire hash using clear().
QHash's key and value data types must be assignable data types. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. In addition, QHash's key type must provide operator==(), and there must also be a global qHash() function that returns a hash value for an argument of the key's type.
Here's a list of the C++ and Qt types that can serve as keys in a QHash: any integer type (char, unsigned long, etc.), any pointer type, QChar, QString, and QByteArray. For all of these, the <QHash> header defines a qHash() function that computes an adequate hash value. If you want to use other types as the key, make sure that you provide operator==() and a qHash() implementation.
Example:
The qHash() function computes a numeric value based on a key. It can use any algorithm imaginable, as long as it always returns the same value if given the same argument. In other words, if e1 == e2
, then qHash(e1) == qHash(e2)
must hold as well. However, to obtain good performance, the qHash() function should attempt to return different hash values for different keys to the largest extent possible.
In the example above, we've relied on Qt's global qHash(const QString &) to give us a hash value for the employee's name, and XOR'ed this with the day they were born to help produce unique hashes for people with the same name.
Internally, QHash uses a hash table to perform lookups. Unlike Qt 3's QDict
class, which needed to be initialized with a prime number, QHash's hash table automatically grows and shrinks to provide fast lookups without wasting too much memory. You can still control the size of the hash table by calling reserve() if you already know approximately how many items the QHash will contain, but this isn't necessary to obtain good performance. You can also call capacity() to retrieve the hash table's size.
Definition at line 66 of file qdatastream.h.
QHash< Key, T >::ConstIterator |
Qt-style synonym for QHash::const_iterator.
QHash< Key, T >::difference_type |
|
private |
Qt-style synonym for QHash::iterator.
QHash< Key, T >::mapped_type |
Constructs a copy of other.
This operation occurs in constant time, because QHash is implicitly shared. This makes returning a QHash from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and this takes linear time.
Definition at line 282 of file qhash.h.
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inline |
Returns an STL-style iterator pointing to the first item in the hash.
Definition at line 464 of file qhash.h.
Referenced by QScriptDebuggerCodeWidgetPrivate::_q_onScriptsChanged(), QPMCache::allPixmaps(), QStateMachinePrivate::applyProperties(), QSet< typename TokenLookupClass::NodeName >::begin(), QGLGlyphCache::cacheGlyphs(), QGLGlyphCache::cleanCache(), QSqlDatabasePrivate::cleanConnections(), QGestureManager::cleanupCachedGestures(), QNetworkAccessCache::clear(), QDeclarativeTimeLine::clear(), QDeclarativePropertyCache::clear(), QDeclarativeTypeLoader::clearCache(), QDeclarativeCompiler::compileTree(), QDeclarativePropertyCache::copy(), QDeclarativeEnginePrivate::createCache(), QPatternist::Template::createContext(), QDeclarativeVisualDataModelPrivate::createMetaData(), ModelNode::dump(), QDeclarativeVisualDataModelPrivate::ensureRoles(), QDeclarativeIntegerCache::findId(), QPMCache::flushDetachedPixmaps(), QAxScriptManager::functions(), QDeclarativeCompiler::genContextCache(), QGraphicsScenePrivate::gestureEventHandler(), QDeclarativeGridView::itemsMoved(), QDeclarativeListView::itemsMoved(), MetaObjectGenerator::metaObject(), QDBusConnectionPrivate::objectDestroyed(), operator<<(), QTextureGlyphCache::populate(), QDeclarativeImports::populateCache(), qDBusRemoveTimeout(), qPRCleanup(), QDeclarativeDebugConnectionPrivate::readyRead(), QDeclarativeTimeLine::remove(), QGraphicsScenePrivate::removeItemHelper(), QFSEventsFileSystemWatcherEngine::removePaths(), QDialogButtonBoxPrivate::retranslateStrings(), QAxScriptManager::scriptForFunction(), QAxScriptManager::scriptNames(), QTextControl::setExtraSelections(), QEventDispatcherMac::unregisterTimers(), ModelNode::updateListIndexes(), QDeclarativeGridViewPrivate::updateUnrequestedIndexes(), QDeclarativeListViewPrivate::updateUnrequestedIndexes(), QDeclarativeGridViewPrivate::updateUnrequestedPositions(), QDeclarativeListViewPrivate::updateUnrequestedPositions(), QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(), QPdfEnginePrivate::writeFonts(), QDeclarativeDataLoader::~QDeclarativeDataLoader(), QDeclarativeDebugConnection::~QDeclarativeDebugConnection(), QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate(), QDeclarativeTimeLine::~QDeclarativeTimeLine(), QEventDispatcherMac::~QEventDispatcherMac(), QPaintBufferResource::~QPaintBufferResource(), and QPrintDialogPrivate::~QPrintDialogPrivate().
|
inline |
|
inline |
Returns the number of buckets in the QHash's internal hash table.
The sole purpose of this function is to provide a means of fine tuning QHash's memory usage. In general, you will rarely ever need to call this function. If you want to know how many items are in the hash, call size().
Definition at line 299 of file qhash.h.
Referenced by QSet< typename TokenLookupClass::NodeName >::capacity().
Q_INLINE_TEMPLATE void QHash< Key, T >::clear | ( | ) |
Removes all items from the hash.
Definition at line 574 of file qhash.h.
Referenced by QGraphicsAnchorLayoutPrivate::calculateGraphs(), QStateMachinePrivate::cancelAllDelayedEvents(), QGLGlyphCache::cleanCache(), QSqlDatabasePrivate::cleanConnections(), cleanup_cmaps(), QmlJSDebugger::LiveSelectionIndicator::clear(), QDeclarativeIntegerCache::clear(), QProcessEnvironment::clear(), QSet< typename TokenLookupClass::NodeName >::clear(), QDeclarativeTypeNameCache::clear(), QNetworkAccessCache::clear(), QDeclarativeTimeLine::clear(), QDeclarativePropertyCache::clear(), ModelNode::clear(), QDeclarativeTypeLoader::clearCache(), QHeaderViewPrivate::clearCascadingSections(), QRelation::clearDictionary(), QmlJSDebugger::AbstractViewInspector::handleMessage(), QGtkStylePrivate::initGtkWidgets(), QTextDocumentLayoutPrivate::layoutTable(), operator>>(), QPatternist::XsdSchemaParser::parse(), QPatternist::NamespaceSupport::popContext(), QSvgIconEngine::read(), QStyleSheetStyle::repolish(), QJSDebuggerAgent::setBreakpoints(), QApplication::setFont(), QApplicationPrivate::setPalette_helper(), QTextDocumentWithImageResources::setText(), QIconLoader::setThemeSearchPath(), QPatternist::ParserContext::templateWithParametersHandled(), QStyleSheetStyle::unpolish(), unregWinClasses(), QPdfEnginePrivate::writeFonts(), QAxBasePrivate::~QAxBasePrivate(), QDBusConnectionManager::~QDBusConnectionManager(), QEventDispatcherMac::~QEventDispatcherMac(), and QGestureManager::~QGestureManager().
|
inlinestaticprivate |
Definition at line 268 of file qhash.h.
|
inline |
Returns a const STL-style iterator pointing to the first item in the hash.
Definition at line 466 of file qhash.h.
Referenced by _q_dupEnvironment(), QStateMachinePrivate::applyProperties(), QPatternist::DelegatingNamespaceResolver::bindings(), QStateMachinePrivate::cancelAllDelayedEvents(), cleanup_cmaps(), QGtkStylePrivate::cleanupGtkWidgets(), QPatternist::TemplateInvoker::compress(), Graph< Vertex, EdgeData >::const_iterator::const_iterator(), QSet< typename TokenLookupClass::NodeName >::constBegin(), QPatternist::ConstructorFunctionsFactory::ConstructorFunctionsFactory(), QPSPrintEnginePrivate::emitPages(), QPatternist::TemplateInvoker::expectedOperandTypes(), QPSPrintEnginePrivate::flushPage(), QApplication::font(), QPatternist::FunctionFactory::hasSignature(), QMacPrintEnginePrivate::initialize(), QProcessEnvironmentPrivate::insert(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QSimplexConstraint::isSatisfied(), QProcessEnvironmentPrivate::keys(), QScriptEnginePrivate::mark(), QScript::QObjectDelegate::markChildren(), Graph< Vertex, EdgeData >::const_iterator::operator++(), operator<<(), QApplication::palette(), QPatternist::PatternPlatform::parseFlags(), QPatternist::NamespaceSupport::prefix(), qt_create_commandline(), QInotifyFileSystemWatcherEngine::readFromInotify(), QEventDispatcherMac::registeredTimers(), QStateMachinePrivate::restorablesToPropertyList(), QDomDocumentTypePrivate::save(), QDomElementPrivate::save(), QSimplex::setConstraints(), QSimplex::simplifyConstraints(), QSimplex::solver(), QFont::substitutions(), QPatternist::TemplateInvoker::TemplateInvoker(), QProcessEnvironmentPrivate::toList(), QSimplexConstraint::toString(), QGraphicsScenePrivate::touchEventHandler(), QApplicationPrivate::translateRawTouchEvent(), QPatternist::CallTemplate::typeCheck(), QHash< QExplicitlySharedDataPointer, QHash >::unite(), QStateMachinePrivate::unregisterEventTransition(), unregWinClasses(), QAxScriptManager::updateScript(), QDBusConnectionManager::~QDBusConnectionManager(), and QScriptEnginePrivate::~QScriptEnginePrivate().
|
inline |
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash.
Definition at line 469 of file qhash.h.
Referenced by _q_dupEnvironment(), QStateMachinePrivate::applyProperties(), QStyleSheetStyleSelector::attribute(), QPatternist::DelegatingNamespaceResolver::bindings(), QGLGlyphCache::cacheGlyphs(), QStateMachinePrivate::cancelAllDelayedEvents(), cleanup_cmaps(), QGtkStylePrivate::cleanupGtkWidgets(), QCoreGraphicsPaintEngine::cleanUpMacColorSpaces(), QPatternist::TemplateInvoker::compress(), QDBusConnectionPrivate::connectRelay(), QDBusConnectionPrivate::connectSignal(), Graph< Vertex, EdgeData >::const_iterator::const_iterator(), QSet< typename TokenLookupClass::NodeName >::constEnd(), QPatternist::ConstructorFunctionsFactory::ConstructorFunctionsFactory(), QMultiHash< const QGLContext *, GLProgram >::contains(), QPSPrintEnginePrivate::emitPages(), QPatternist::TemplateInvoker::expectedOperandTypes(), QDeclarativeJS::Ecma::RegExp::flagFromChar(), QPSPrintEnginePrivate::flushPage(), QApplication::font(), QDBusConnectionPrivate::getNameOwner(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertySlot(), QDBusConnectionPrivate::handleSignal(), QPatternist::FunctionFactory::hasSignature(), QStyleSheetStyle::hasStyleRule(), QSortFilterProxyModelPrivate::index_to_iterator(), QMacPrintEnginePrivate::initialize(), QApplicationPrivate::initializeWidgetPaletteHash(), QProcessEnvironmentPrivate::insert(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QSimplexConstraint::isSatisfied(), QProcessEnvironmentPrivate::keys(), QScriptEnginePrivate::mark(), QScript::QObjectDelegate::markChildren(), QDesktopServices::openUrl(), Graph< Vertex, EdgeData >::const_iterator::operator++(), operator<<(), QApplication::palette(), QPatternist::PatternPlatform::parseFlags(), QJSDebuggerAgentPrivate::positionChange(), QPatternist::NamespaceSupport::prefix(), QScript::QObjectDelegate::put(), QScriptEnginePrivate::qobjectData(), qPRCleanup(), qt_create_commandline(), qt_gl_choose_cmap(), QInotifyFileSystemWatcherEngine::readFromInotify(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::relink(), QStyleSheetStyle::renderRule(), QStateMachinePrivate::restorablesToPropertyList(), QDomDocumentTypePrivate::save(), QDomElementPrivate::save(), QSimplex::setConstraints(), QSimplex::simplifyConstraints(), QDBusConnectionPrivate::socketRead(), QDBusConnectionPrivate::socketWrite(), QSimplex::solver(), QAuServerMac::stop(), QStyleSheetStyle::styleRules(), QFont::substitute(), QFont::substitutions(), QPatternist::TemplateInvoker::TemplateInvoker(), QProcessEnvironmentPrivate::toList(), QSimplexConstraint::toString(), QGraphicsScenePrivate::touchEventHandler(), QApplicationPrivate::translateRawTouchEvent(), QPatternist::CallTemplate::typeCheck(), QHash< QExplicitlySharedDataPointer, QHash >::unite(), QStateMachinePrivate::unregisterEventTransition(), unregWinClasses(), QAxScriptManager::updateScript(), QProcessEnvironment::value(), QDBusConnectionManager::~QDBusConnectionManager(), and QScriptEnginePrivate::~QScriptEnginePrivate().
Q_INLINE_TEMPLATE QHash< Key, T >::const_iterator QHash< Key, T >::constFind | ( | const Key & | key | ) | const |
Returns an iterator pointing to the item with the key in the hash.
If the hash contains no item with the key, the function returns constEnd().
Definition at line 859 of file qhash.h.
Referenced by QStyleSheetStyleSelector::attribute(), QGLGlyphCache::cacheGlyphs(), QDeclarativeJS::Ecma::RegExp::flagFromChar(), QApplication::font(), QDBusConnectionPrivate::getNameOwner(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertySlot(), QStyleSheetStyle::hasStyleRule(), QApplicationPrivate::initializeWidgetPaletteHash(), QDesktopServices::openUrl(), QMultiHash< const QGLContext *, GLProgram >::operator+(), QApplication::palette(), QScript::QObjectDelegate::put(), QScriptEnginePrivate::qobjectData(), qt_gl_choose_cmap(), QStyleSheetStyle::renderRule(), QAuServerMac::stop(), QStyleSheetStyle::styleRules(), QFont::substitute(), and QProcessEnvironment::value().
Q_INLINE_TEMPLATE bool QHash< Key, T >::contains | ( | const Key & | key | ) | const |
Returns true if the hash contains an item with the key; otherwise returns false.
Definition at line 872 of file qhash.h.
Referenced by _q_dupEnvironment(), QDeclarativeIntegerCache::add(), QDeclarativeTypeNameCache::add(), QGraphicsAnchorLayoutPrivate::addAnchorMaybeParallel(), QPatternist::XsdSchema::addAnonymousType(), QSqlDatabasePrivate::addDatabase(), QPatternist::XsdSchemaParser::addFacet(), QDeclarativeCompiler::addId(), QAxScriptManager::addObject(), QWindowsFileSystemWatcherEngine::addPaths(), QWSPropertyManager::addProperty(), QPatternist::XsdValidatingInstanceReader::addSchema(), FlatListModel::addValue(), QDeclarativePropertyCache::append(), QStateMachinePrivate::applyProperties(), QPatternist::XsdInstanceReader::attribute(), QDeclarativeCompiler::buildComponent(), QDeclarativeCompiler::buildIdProperty(), callback(), QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdTypeChecker::checkConstrainingFacetsBinary(), QPatternist::XsdTypeChecker::checkConstrainingFacetsBoolean(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDateTime(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDecimal(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDouble(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDuration(), QPatternist::XsdTypeChecker::checkConstrainingFacetsList(), QPatternist::XsdTypeChecker::checkConstrainingFacetsNotation(), QPatternist::XsdTypeChecker::checkConstrainingFacetsQName(), QPatternist::XsdTypeChecker::checkConstrainingFacetsSignedInteger(), QPatternist::XsdTypeChecker::checkConstrainingFacetsString(), QPatternist::XsdTypeChecker::checkConstrainingFacetsUnion(), QPatternist::XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QGtkStylePrivate::cleanupGtkWidgets(), QPatternist::ColorOutput::colorify(), QPatternist::ColoringMessageHandler::colorifyDescription(), QDeclarativeCompiler::compileAlias(), QDeclarativeCompiler::compileTree(), EGLNullWSScreen::connect(), QAxBase::connectNotify(), QProcessEnvironment::contains(), QSet< typename TokenLookupClass::NodeName >::contains(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::contains(), QPatternist::Template::createContext(), QPatternist::XsdSchemaTypesFactory::createSchemaType(), QEventDispatcherWin32Private::doWsaAsyncSelect(), QSvgFont::draw(), QDeclarativePath::endpoint(), QPatternist::TypeAvailableFN::evaluateSingleton(), familyNameFromPostScriptName(), QNetworkAccessHttpBackend::fetchCacheMetaData(), QGestureManager::filterEvent(), QRegExpEngine::getEscape(), QGraphicsAnchorLayoutPrivate::getGraphParts(), QSharedNetworkSessionManager::getSession(), QApplicationPrivate::globalEventProcessor(), QTextLine::glyphs(), QStateMachinePrivate::handleFilteredEvent(), QScriptDebuggerPrivate::handleResponse(), QPatternist::XsdInstanceReader::hasAttribute(), hasDuplicatedElementsInternal(), QNetworkAccessCache::hasEntry(), QBBEngine::hasIdentifier(), QWSPropertyManager::hasProperty(), QRenderRule::hasStyleHint(), QGtkStylePrivate::initGtkWidgets(), QDeclarativePath::interpolate(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QPatternist::XsdSchemaHelper::isValidAttributeUsesRestriction(), launchWebBrowser(), QNetworkAccessHttpBackend::loadFromCacheIfAllowed(), QFSFileEnginePrivate::longFileName(), QNetworkReplyImplPrivate::metaDataChanged(), QPatternist::XsdTypeChecker::normalizedValue(), QAxMetaObject::numParameter(), QMultiHash< const QGLContext *, GLProgram >::operator+(), QAxMetaObject::paramType(), QXmlStreamReaderPrivate::parse(), parseServerList(), QStyleSheetStyle::polish(), QTextureGlyphCache::populate(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::proceed(), QPatternist::NamespaceSupport::processName(), QDeclarativePath::processPath(), qt_create_commandline(), qt_mac_handleTabletEvent(), QtWndProc(), QPatternist::XSLTTokenizer::readAlternativeAttribute(), QInotifyFileSystemWatcherEngine::readFromInotify(), QDeclarativeMetaType::registerCustomStringConverter(), QEventDispatcherWin32::registerSocketNotifier(), QFreetypeFace::release(), QSqlDatabasePrivate::removeDatabase(), QDeclarativeWatcher::removeWatch(), QNetworkAccessHttpBackend::replyDownloadMetaData(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveEnumerationFacetValues(), QHeaderViewPrivate::saveCascadingSectionSize(), QSqlRelationalTableModel::setData(), QmlJSDebugger::LiveSelectionIndicator::setItems(), ModelNode::setObjectValue(), QSimplex::simplifyConstraints(), QPatternist::XsdSchemaChecker::sourceLocation(), QPatternist::AccelTree::sourceLocation(), QPatternist::XsdSchemaResolver::sourceLocation(), FlatListModel::toString(), QFSFileEnginePrivate::unmap(), QGestureManager::unregisterGestureRecognizer(), QStyleSheetStyle::unsetPalette(), QMenuPrivate::updateActionRects(), and QPatternist::XsdValidatingInstanceReader::validateElementComplexType().
Q_OUTOFLINE_TEMPLATE int QHash< Key, T >::count | ( | const Key & | key | ) | const |
Returns the number of items associated with the key.
Definition at line 719 of file qhash.h.
Referenced by _q_dupEnvironment(), QDeclarativeCompiler::addId(), FlatListModel::addValue(), QDeclarativeCompiler::buildObject(), QDeclarativeCompiler::completeComponentBuild(), QAxBase::connectNotify(), QDeclarativeIntegerCache::count(), QDeclarativeOpenMetaObject::count(), QSet< typename TokenLookupClass::NodeName >::count(), QPatternist::XSLTTokenizer::createElementDescriptions(), QDeclarativeVisualDataModelPrivate::createMetaData(), QDeclarativeCompiler::genContextCache(), QDeclarativeGridView::itemsMoved(), QDeclarativeListView::itemsMoved(), QDeclarativeOpenMetaObject::name(), QPatternist::AccelTree::printStats(), QDeclarativeBindingCompiler::program(), FlatListModel::setProperty(), and QSimplex::simplifyConstraints().
|
inline |
Same as size().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 475 of file qhash.h.
Referenced by QMultiHash< const QGLContext *, GLProgram >::operator+().
|
private |
Definition at line 538 of file qhash.h.
|
private |
|
staticprivate |
|
inline |
Detaches this hash from any other hashes with which it may share data.
Definition at line 303 of file qhash.h.
Referenced by QSet< typename TokenLookupClass::NodeName >::detach().
|
private |
Definition at line 580 of file qhash.h.
|
staticprivate |
Definition at line 526 of file qhash.h.
|
inline |
This function is provided for STL compatibility.
It is equivalent to isEmpty(), returning true if the hash is empty; otherwise returns false.
Definition at line 489 of file qhash.h.
|
inline |
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash.
Definition at line 467 of file qhash.h.
Referenced by QStateMachinePrivate::_q_animationFinished(), QScriptEnginePrivate::_q_objectDestroyed(), QScriptDebuggerCodeWidgetPrivate::_q_onScriptsChanged(), QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished(), QDeclarativeTypeLoader::absoluteFilePath(), QDeclarativeFastProperties::accessorIndexForProperty(), QDeclarativeTimeLinePrivate::add(), QDeclarativeContextData::addImportedScript(), FlatListModel::addValue(), QPMCache::allPixmaps(), QStateMachinePrivate::applyProperties(), QGLGlyphCache::cacheGlyphs(), callback(), QMetaObject::changeGuard(), QGLGlyphCache::cleanCache(), QSqlDatabasePrivate::cleanConnections(), QGestureManager::cleanupCachedGestures(), QNetworkAccessCache::clear(), QDeclarativeTimeLine::clear(), QDeclarativePropertyCache::clear(), QDeclarativeTypeLoader::clearCache(), QObjectPrivate::clearGuards(), QDeclarativeCompiler::compileTree(), QDBusConnectionPrivate::connectSignal(), QDeclarativePropertyCache::copy(), QPersistentModelIndexData::create(), QDeclarativeEnginePrivate::createCache(), QPatternist::Template::createContext(), QDeclarativeVisualDataModelPrivate::createMetaData(), NestedListModel::data(), QScript::QObjectDelegate::deleteProperty(), QDBusConnectionPrivate::disconnectRelay(), QDBusConnectionPrivate::disconnectSignal(), QParallelAnimationGroupPrivate::disconnectUncontrolledAnimations(), ModelNode::dump(), QSet< typename TokenLookupClass::NodeName >::end(), QDeclarativeVisualDataModelPrivate::ensureRoles(), QDeclarativeIntegerCache::findId(), QPMCache::flushDetachedPixmaps(), QGLGlyphCache::fontEngineDestroyed(), QAxScriptManager::functions(), QDeclarativeCompiler::genContextCache(), QGraphicsScenePrivate::gestureEventHandler(), QWSPropertyManager::getProperty(), QTextFormatCollection::hasFormatCached(), QTextFormatCollection::indexForFormat(), QDeclarativeVisualDataModelDataMetaObject::initialValue(), QPaintBufferResource::insert(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QDeclarativeMetaType::isModule(), QNetworkAccessCache::linkEntry(), QDeclarativeEnginePrivate::listType(), QDeclarativePixmap::load(), QTextDocumentWithImageResources::loadResource(), QReadWriteLock::lockForRead(), MetaObjectGenerator::metaObject(), QDBusConnectionPrivate::objectDestroyed(), Graph< Vertex, EdgeData >::const_iterator::operator!=(), operator<<(), QHash< QExplicitlySharedDataPointer, QHash >::operator==(), QDeclarativeOpenMetaObject::operator[](), QTextureGlyphCache::populate(), QDeclarativeImports::populateCache(), QDeclarativeVisualDataModelData::propForRole(), qDBusRealToggleWatch(), qDBusRemoveTimeout(), qDBusRemoveWatch(), QDeclarativeType::QDeclarativeType(), QDeclarativeTypeLoader::qmlDirParser(), QDeclarativeMetaType::qmlType(), QDeclarativeDebugConnectionPrivate::readyRead(), QDnotifyFileSystemWatcherEngine::refresh(), QDeclarativeBindingCompilerPrivate::registerString(), registerType(), QNetworkAccessCache::releaseEntry(), QDeclarativeTimeLine::remove(), QPaintBufferResource::remove(), QNetworkAccessCache::removeEntry(), QMetaObject::removeGuard(), QGraphicsScenePrivate::removeItemHelper(), QFSEventsFileSystemWatcherEngine::removePaths(), QWSPropertyManager::removeProperty(), QGtkStylePrivate::removeWidgetFromMap(), QNetworkAccessCache::requestEntry(), QNetworkAccessCache::requestEntryNow(), QDialogButtonBoxPrivate::retranslateStrings(), QAxScriptManager::scriptForFunction(), QAxScriptManager::scriptNames(), QDBusConnectionPrivate::serviceOwnerChangedNoLock(), QTextControl::setExtraSelections(), QWSPropertyManager::setProperty(), FlatListModel::setProperty(), ModelNode::setProperty(), QDeclarativeOpenMetaObject::setValue(), QDeclarativeBindingCompilerPrivate::subscriptionIndex(), QDeclarativeTimeLine::sync(), QReadWriteLock::tryLockForRead(), QNetworkAccessCache::unlinkEntry(), QReadWriteLock::unlock(), ModelNode::updateListIndexes(), QDeclarativeGridViewPrivate::updateUnrequestedIndexes(), QDeclarativeListViewPrivate::updateUnrequestedIndexes(), QDeclarativeGridViewPrivate::updateUnrequestedPositions(), QDeclarativeListViewPrivate::updateUnrequestedPositions(), QDeclarativeOpenMetaObject::value(), QPaintBufferResource::value(), QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(), QPdfEnginePrivate::writeFonts(), QDeclarativeDataLoader::~QDeclarativeDataLoader(), QDeclarativeDebugConnection::~QDeclarativeDebugConnection(), QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate(), QDeclarativeTimeLine::~QDeclarativeTimeLine(), QPaintBufferResource::~QPaintBufferResource(), and QPrintDialogPrivate::~QPrintDialogPrivate().
|
inline |
Q_OUTOFLINE_TEMPLATE QHash< Key, T >::iterator QHash< Key, T >::erase | ( | iterator | pos | ) |
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator to the next item in the hash.
Unlike remove() and take(), this function never causes QHash to rehash its internal data structure. This means that it can safely be called while iterating, and won't affect the order of items in the hash. For example:
Definition at line 827 of file qhash.h.
Referenced by QStateMachinePrivate::_q_animationFinished(), QScriptEnginePrivate::_q_objectDestroyed(), QScriptDebuggerCodeWidgetPrivate::_q_onScriptsChanged(), QStateMachinePrivate::applyProperties(), QMetaObject::changeGuard(), QObjectPrivate::clearGuards(), QScript::QObjectDelegate::deleteProperty(), QDBusConnectionPrivate::disconnectSignal(), QSet< typename TokenLookupClass::NodeName >::erase(), QPMCache::flushDetachedPixmaps(), qDBusRemoveTimeout(), qDBusRemoveWatch(), qPRCleanup(), QDeclarativeTimeLine::remove(), QPaintBufferResource::remove(), QMetaObject::removeGuard(), QGraphicsScenePrivate::removeItemHelper(), QFSEventsFileSystemWatcherEngine::removePaths(), QGtkStylePrivate::removeWidgetFromMap(), QWindowsFileSystemWatcherEngineThread::run(), QTextControl::setExtraSelections(), QReadWriteLock::unlock(), QEventDispatcherMac::unregisterTimers(), and QPrintDialogPrivate::~QPrintDialogPrivate().
Q_INLINE_TEMPLATE QHash< Key, T >::iterator QHash< Key, T >::find | ( | const Key & | key | ) |
Returns an iterator pointing to the item with the key in the hash.
If the hash contains no item with the key, the function returns end().
If the hash contains multiple items with the key, this function returns an iterator that points to the most recently inserted value. The other values are accessible by incrementing the iterator. For example, here's some code that iterates over all the items with the same key:
Definition at line 865 of file qhash.h.
Referenced by QStateMachinePrivate::_q_animationFinished(), QScriptEnginePrivate::_q_objectDestroyed(), QDeclarativeTypeLoader::absoluteFilePath(), QDeclarativeFastProperties::accessorIndexForProperty(), QDeclarativeTimeLinePrivate::add(), QDeclarativeContextData::addImportedScript(), FlatListModel::addValue(), callback(), QDBusConnectionPrivate::connectSignal(), QPersistentModelIndexData::create(), NestedListModel::data(), QScript::QObjectDelegate::deleteProperty(), QDBusConnectionPrivate::disconnectSignal(), QSet< typename TokenLookupClass::NodeName >::find(), QGLGlyphCache::fontEngineDestroyed(), QWSPropertyManager::getProperty(), QDeclarativeVisualDataModelDataMetaObject::initialValue(), QPaintBufferResource::insert(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QDeclarativeMetaType::isModule(), QNetworkAccessCache::linkEntry(), QDeclarativeEnginePrivate::listType(), QDeclarativePixmap::load(), QTextDocumentWithImageResources::loadResource(), QReadWriteLock::lockForRead(), QMultiHash< const QGLContext *, GLProgram >::operator+(), operator<<(), QHash< QExplicitlySharedDataPointer, QHash >::operator==(), QDeclarativeOpenMetaObject::operator[](), QDeclarativeVisualDataModelData::propForRole(), QDeclarativeType::QDeclarativeType(), QDeclarativeTypeLoader::qmlDirParser(), QDeclarativeMetaType::qmlType(), QDeclarativeDebugConnectionPrivate::readyRead(), QDnotifyFileSystemWatcherEngine::refresh(), QDeclarativeBindingCompilerPrivate::registerString(), registerType(), QNetworkAccessCache::releaseEntry(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::relink(), QDeclarativeTimeLine::remove(), QPaintBufferResource::remove(), QNetworkAccessCache::removeEntry(), QWSPropertyManager::removeProperty(), QGtkStylePrivate::removeWidgetFromMap(), QNetworkAccessCache::requestEntry(), QNetworkAccessCache::requestEntryNow(), QDBusConnectionPrivate::serviceOwnerChangedNoLock(), QTextControl::setExtraSelections(), QWSPropertyManager::setProperty(), FlatListModel::setProperty(), ModelNode::setProperty(), QDeclarativeOpenMetaObject::setValue(), QDeclarativeBindingCompilerPrivate::subscriptionIndex(), QDeclarativeTimeLine::sync(), QReadWriteLock::tryLockForRead(), QNetworkAccessCache::unlinkEntry(), QReadWriteLock::unlock(), QDeclarativeOpenMetaObject::value(), and QPaintBufferResource::value().
Q_INLINE_TEMPLATE QHash< Key, T >::const_iterator QHash< Key, T >::find | ( | const Key & | key | ) | const |
|
private |
Definition at line 878 of file qhash.h.
|
private |
Q_INLINE_TEMPLATE QHash< Key, T >::iterator QHash< Key, T >::insert | ( | const Key & | key, |
const T & | value | ||
) |
Inserts a new item with the key and a value of value.
If there is already an item with the key, that item's value is replaced with value.
If there are multiple items with the key, the most recently inserted item's value is replaced with value.
Definition at line 753 of file qhash.h.
Referenced by QDeclarativeVisualDataModel::_q_itemsInserted(), QDeclarativeVisualDataModel::_q_itemsMoved(), QDeclarativeVisualDataModel::_q_itemsRemoved(), QDeclarativeTypeLoader::absoluteFilePath(), QDeclarativeFastProperties::add(), QDeclarativeIntegerCache::add(), QDeclarativeTypeNameCache::add(), QDeclarativeTimeLinePrivate::add(), QGraphicsAnchorLayoutPrivate::addAnchorMaybeParallel(), QPatternist::XsdSchema::addAnonymousType(), QPatternist::XsdSchemaParser::addAnonymousType(), QPatternist::XsdSchemaParser::addAttribute(), QPatternist::XsdSchemaParser::addAttributeGroup(), QPatternist::GenericNamespaceResolver::addBinding(), QPatternist::DelegatingNamespaceResolver::addBinding(), MetaObjectGenerator::addChangedSignal(), QPdfEnginePrivate::addConstantAlphaObject(), QSqlDatabasePrivate::addDatabase(), QPatternist::XsdSchemaParser::addElement(), QPatternist::XsdSchemaParser::addElementGroup(), QPatternist::XsdSchemaParser::addFacet(), QSvgIconEngine::addFile(), QPatternist::AbstractFunctionFactory::addFunction(), QSvgFont::addGlyph(), QDeclarativeCompiler::addId(), QPatternist::XsdSchemaParser::addIdentityConstraint(), QPdfEnginePrivate::addImage(), QDeclarativeContextData::addImportedScript(), QGraphicsAnchorLayoutPrivate::addInternalVertex(), QPatternist::GenericStaticContext::addLocation(), QSvgTinyDocument::addNamedNode(), QSvgTinyDocument::addNamedStyle(), QPatternist::XsdSchemaParser::addNotation(), QAxScriptManager::addObject(), QInotifyFileSystemWatcherEngine::addPaths(), QKqueueFileSystemWatcherEngine::addPaths(), QWindowsFileSystemWatcherEngine::addPaths(), QSvgIconEngine::addPixmap(), QPatternist::XsdValidatingInstanceReader::addSchema(), QSvgTinyDocument::addSvgFont(), QPatternist::XsdSchema::addType(), QPatternist::XsdSchemaParser::addType(), FlatListModel::addValue(), QGtkStylePrivate::addWidgetToMap(), QDirectFbInput::addWindow(), QDeclarativePropertyCache::append(), QStateMachinePrivate::applyProperties(), QPatternist::PullBridge::attributeItems(), QPatternist::PullBridge::attributes(), QGLGlyphCache::cacheGlyphs(), QScriptObjectSnapshot::capture(), QPatternist::XQueryTokenizer::charForReference(), QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QPatternist::ColoringMessageHandler::ColoringMessageHandler(), QAxBase::connectNotify(), QDBusConnectionPrivate::connectSignal(), GraphPath::constraint(), QGraphicsAnchorLayoutPrivate::constraintsFromSizeHints(), QPatternist::ConstructorFunctionsFactory::ConstructorFunctionsFactory(), convertWithPalette(), QPersistentModelIndexData::create(), QDialogButtonBoxPrivate::createButton(), QGraphicsAnchorLayoutPrivate::createCenterAnchors(), Graph< AnchorVertex, AnchorData >::createDirectedEdge(), QPatternist::XSLTTokenizer::createElementDescriptions(), QDeclarativeVisualDataModelPrivate::createMetaData(), QDBusMetaObject::createMetaObject(), QDeclarativeOpenMetaObjectType::createProperty(), createSlack(), QPatternist::XSLTTokenizer::createValidationAlternatives(), QDeclarativeXmlListModel::data(), NestedListModel::data(), QPatternist::GenericNamespaceResolver::defaultXQueryBindings(), QPatternist::GenericNamespaceResolver::defaultXSLTBindings(), QGestureManager::deliverEvents(), QNetworkManagerEngine::deviceAdded(), QPatternist::AccelTreeResourceLoader::deviceURIs(), QAxMetaObject::dispIDofName(), QPdfBaseEnginePrivate::drawTextItem(), QDeclarativePath::endpoint(), QDeclarativeVisualDataModelPrivate::ensureRoles(), QPatternist::FunctionAvailableFN::evaluateSingleton(), QNetworkAccessHttpBackend::fetchCacheMetaData(), flagDescriptions(), QDeclarativeListModel::flatten(), QConfFile::fromName(), QPatternist::FunctionFactoryCollection::functionSignatures(), QDeclarativeTypeLoader::get(), Maemo::GConfItemFast::getEntries(), QFreetypeFace::getFace(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertySlot(), QDeclarativeTypeLoader::getQmldir(), QDeclarativeTypeLoader::getScript(), QTextLine::glyphs(), QmlJSDebugger::AbstractViewInspector::handleMessage(), hasDuplicatedElementsInternal(), QDirModelPrivate::init(), QFileSystemModelPrivate::init(), QNetworkReplyImplPrivate::initCacheSaveDevice(), initDefaultPaths(), QGtkStylePrivate::initGtkWidgets(), QNetworkManagerEngine::initialize(), QProcessEnvironment::insert(), QSet< typename TokenLookupClass::NodeName >::insert(), QPMCache::insert(), QProcessEnvironmentPrivate::insert(), QPaintBufferResource::insert(), QPatternist::ColorOutput::insertMapping(), QDeclarativeXmlQueryEngine::instance(), internalParticleLookupMap(), QDeclarativePath::interpolate(), QAxServerBase::Invoke(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QPatternist::XsdSchemaHelper::isValidAttributeUsesExtension(), QPatternist::XsdSchemaHelper::isValidAttributeUsesRestriction(), QDeclarativeGridView::itemsMoved(), QDeclarativeListView::itemsMoved(), QDeclarativeDataLoader::load(), QTextDocumentWithImageResources::loadResource(), QReadWriteLock::lockForRead(), QMenuBarPrivate::macMenu(), QMenuPrivate::macMenu(), QPatternist::XsdTypeChecker::mergedFacetsForType(), MetaObjectGenerator::metaObject(), QPatternist::NamespaceSupport::NamespaceSupport(), QDeclarativeDataLoader::networkReplyFinished(), QDeclarativePixmapReader::networkRequestDone(), QPrintDialogPrivate::openCarbonPrintPanel(), QPatternist::Template::parametersAsHash(), QXmlStreamReaderPrivate::parse(), parseHttpOptionHeader(), QPatternist::XsdSchemaParser::parseList(), QPatternist::XsdSchemaParser::parseLocalAttribute(), QBBButtonEventNotifier::parsePPS(), QAxMetaObject::parsePrototype(), parseServerList(), QAuServerNAS::play(), QTextureGlyphCache::populate(), QJSDebuggerAgentPrivate::positionChange(), QScript::QObjectDelegate::put(), QAxScript::QAxScript(), QDBusConnectionPrivate::QDBusConnectionPrivate(), QDeclarativePackageAttached::QDeclarativePackageAttached(), QDeclarativeType::QDeclarativeType(), qmlAttachedPropertiesObjectById(), QDeclarativeTypeLoader::qmlDirParser(), QNetworkReplyPrivate::QNetworkReplyPrivate(), QScriptEnginePrivate::qobjectData(), qPRCreate(), qt_create_commandline(), qt_dispatchTabletProximityEvent(), qt_gl_choose_cmap(), qt_x11_set_fallback_font_family(), QSvgIconEngine::read(), MetaObjectGenerator::readEnumInfo(), MetaObjectGenerator::readEventInterface(), QInotifyFileSystemWatcherEngine::readFromInotify(), QNetworkReplyImplPrivate::redirectionRequested(), QDeclarativeMetaType::registerCustomStringConverter(), QDeclarativeVMEMetaObject::registerInterceptor(), registerInterface(), QEventDispatcherWin32::registerSocketNotifier(), QDeclarativeBindingCompilerPrivate::registerString(), QEventDispatcherMac::registerTimer(), registerType(), QGraphicsAnchorLayoutPrivate::removeInternalVertex(), QMultiHash< const QGLContext *, GLProgram >::replace(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QGraphicsAnchorLayoutPrivate::restoreSimplifiedConstraints(), QPatternist::AccelTreeResourceLoader::retrieveUnparsedText(), QHeaderViewPrivate::saveCascadingSectionSize(), QScriptDebuggerPrivate::scheduleCommand(), QJSDebuggerAgent::scriptLoad(), QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(), QSqlRelationalTableModel::selectStatement(), QNetworkRequest::setAttribute(), QNetworkAccessBackend::setAttribute(), QDeclarativeListModelParser::setCustomData(), QScriptEnginePrivate::setDefaultPrototype(), QApplication::setFont(), QmlJSDebugger::LiveSelectionIndicator::setItems(), ModelNode::setObjectValue(), QAuthenticator::setOption(), QStyleSheetStyle::setPalette(), QApplicationPrivate::setPalette_helper(), QSettings::setPath(), QPatternist::NamespaceSupport::setPrefix(), QPatternist::NamespaceSupport::setPrefixes(), FlatListModel::setProperty(), ModelNode::setProperty(), QNetworkSessionPrivateImpl::setSessionProperty(), QPatternist::NamespaceSupport::setTargetNamespace(), QPatternist::XsdSchemaChecker::setupAllowedAtomicFacets(), QPatternist::XsdSchemaContext::setupBuiltinTypesFacetList(), QRegExpEngine::setupCategoriesRangeMap(), QDesktopServices::setUrlHandler(), QSimplex::simplifyConstraints(), QGraphicsAnchorLayoutPrivate::solveMinMax(), QGraphicsAnchorLayoutPrivate::solvePreferred(), QWidgetPrivate::stackUnder_sys(), QStyleSheetStyle::styleRules(), QDeclarativeBindingCompilerPrivate::subscriptionIndex(), QProcessEnvironment::systemEnvironment(), MetaObjectGenerator::tryCache(), QReadWriteLock::tryLockForRead(), QPatternist::ElementConstructor::typeCheck(), QPatternist::NamePool::unlockedAllocateLocalName(), QPatternist::NamePool::unlockedAllocateNamespace(), QPatternist::NamePool::unlockedAllocatePrefix(), QGestureManager::unregisterGestureRecognizer(), QBBEngine::updateConfiguration(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), QSvgIconEngine::write(), and QPatternist::XsdSchemaTypesFactory::XsdSchemaTypesFactory().
Q_INLINE_TEMPLATE QHash< Key, T >::iterator QHash< Key, T >::insertMulti | ( | const Key & | key, |
const T & | value | ||
) |
Inserts a new item with the key and a value of value.
If there is already an item with the same key in the hash, this function will simply create a new one. (This behavior is different from insert(), which overwrites the value of an existing item.)
Definition at line 772 of file qhash.h.
Referenced by QDeclarativeVisualDataModel::_q_itemsRemoved(), QDBusConnectionPrivate::connectSignal(), QDirModelPrivate::init(), QFileSystemModelPrivate::init(), QMultiHash< const QGLContext *, GLProgram >::insert(), QDomDocumentTypePrivate::insertAfter(), QDomDocumentTypePrivate::insertBefore(), QTextDocumentLayoutPrivate::layoutTable(), operator>>(), qDBusRealAddWatch(), QDomDocumentTypePrivate::QDomDocumentTypePrivate(), registerType(), QDomDocumentTypePrivate::replaceChild(), QJSDebuggerAgent::setBreakpoints(), and QTextControl::setExtraSelections().
|
inline |
Returns true if the hash's internal data isn't shared with any other hash object; otherwise returns false.
Definition at line 304 of file qhash.h.
Referenced by QSet< typename TokenLookupClass::NodeName >::isDetached().
|
inline |
Returns true if the hash contains no items; otherwise returns false.
Definition at line 297 of file qhash.h.
Referenced by _q_dupEnvironment(), QStateMachinePrivate::applyProperties(), QPatternist::XQueryTokenizer::charForReference(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), QObjectPrivate::clearGuards(), QDeclarativeVisualDataModelPrivate::ensureRoles(), QGtkStyleFilter::eventFilter(), QCoreTextFontDatabase::fallbacksForFamily(), QDeclarativeJS::Ecma::RegExp::flagFromChar(), QRegExpEngine::getEscape(), getPath(), QTextDocumentLayoutPrivate::hitTest(), initDefaultPaths(), initFontSubst(), QApplicationPrivate::initializeWidgetPaletteHash(), QDeclarativeTimeLine::isActive(), QSet< typename TokenLookupClass::NodeName >::isEmpty(), QProcessEnvironment::isEmpty(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::isEmpty(), QPatternist::XsdSchemaHelper::isSimpleDerivationOk(), QTextureGlyphCache::populate(), QPatternist::NamespaceSupport::processName(), qt_create_commandline(), qt_gl_choose_cmap(), QFreetypeFace::release(), QDeclarativeTimeLine::remove(), Graph< AnchorVertex, AnchorData >::removeDirectedEdge(), QMetaObject::removeGuard(), QKqueueFileSystemWatcherEngine::removePaths(), QWindowsFileSystemWatcherEngine::removePaths(), QWindowsFileSystemWatcherEngineThread::run(), QDomElementPrivate::save(), QSettings::setPath(), QTextDocumentWithImageResources::setText(), QSimplex::simplifyConstraints(), QGraphicsScenePrivate::touchEventHandler(), QApplicationPrivate::translateRawTouchEvent(), QDeclarativeTimeLine::updateCurrentTime(), updateWidgets(), NestedListModel::valueForNode(), and QTextDocumentWithImageResources::~QTextDocumentWithImageResources().
Q_OUTOFLINE_TEMPLATE const Key QHash< Key, T >::key | ( | const T & | value | ) | const |
Returns the first key mapped to value.
If the hash contains no item with the value, the function returns a default-constructed key.
This function can be slow (linear time), because QHash's internal data structure is optimized for fast lookup by key, not by value.
Definition at line 674 of file qhash.h.
Referenced by QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished(), QPMCache::allPixmaps(), QStateMachinePrivate::applyProperties(), QDeclarativeVisualDataModelPrivate::createMetaData(), QParallelAnimationGroupPrivate::disconnectUncontrolledAnimations(), Graph< Vertex, EdgeData >::const_iterator::from(), QTextFormatCollection::hasFormatCached(), QTextFormatCollection::indexForFormat(), QMacPrintEnginePrivate::initialize(), QHeaderView::initializeSections(), QProcessEnvironmentPrivate::insert(), QSimplexConstraint::isSatisfied(), Graph< Vertex, EdgeData >::const_iterator::operator*(), operator<<(), QDialogButtonBoxPrivate::retranslateStrings(), QScriptDebuggerCodeWidgetPrivate::scriptId(), QSimplex::setConstraints(), QSimplex::simplifyConstraints(), QSimplex::solver(), Graph< Vertex, EdgeData >::const_iterator::to(), QSimplexConstraint::toString(), unregWinClasses(), QDeclarativeGridViewPrivate::updateUnrequestedIndexes(), QDeclarativeListViewPrivate::updateUnrequestedIndexes(), QDeclarativeGridViewPrivate::updateUnrequestedPositions(), and QDeclarativeListViewPrivate::updateUnrequestedPositions().
Q_OUTOFLINE_TEMPLATE const Key QHash< Key, T >::key | ( | const T & | value, |
const Key & | defaultKey | ||
) | const |
Returns the first key mapped to value, or defaultKey if the hash contains no item mapped to value.
This function can be slow (linear time), because QHash's internal data structure is optimized for fast lookup by key, not by value.
Definition at line 680 of file qhash.h.
Q_OUTOFLINE_TEMPLATE QList< Key > QHash< Key, T >::keys | ( | ) | const |
Returns a list containing all the keys in the hash, in an arbitrary order.
Keys that occur multiple times in the hash (because items were inserted with insertMulti(), or unite() was used) also occur multiple times in the list.
To obtain a list of unique keys, where each key from the map only occurs once, use uniqueKeys().
The order is guaranteed to be the same as that used by values().
Definition at line 648 of file qhash.h.
Referenced by Graph< AnchorVertex, AnchorData >::adjacentVertices(), QDeclarativeDebugConnectionPrivate::advertisePlugins(), QDeclarativeDebugServerPrivate::advertisePlugins(), QPatternist::XsdInstanceReader::attributeNames(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), NestedListModel::checkRoles(), QGLGlyphCache::cleanupContext(), QGestureManager::cleanupGesturesForRemovedRecognizer(), QDeclarativeDebugConnectionPrivate::connected(), QGestureManager::getGestureTargets(), QGraphicsAnchorLayoutPrivate::getGraphParts(), getVariables(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::keys(), printHelp(), QDeclarativePropertyCache::propertyNames(), qDBusRealAddTimeout(), QDeclarativeMetaType::qmlTypeNames(), QSvgIconEngine::read(), QStyleSheetStyle::repolish(), FlatListModel::roles(), QNetworkManagerEngine::sessionStateForId(), QStyleSheetStyle::setProperties(), QGestureManager::unregisterGestureRecognizer(), QSvgIconEngine::write(), and QGestureManager::~QGestureManager().
Q_OUTOFLINE_TEMPLATE QList< Key > QHash< Key, T >::keys | ( | const T & | value | ) | const |
Returns a list containing all the keys associated with value value, in an arbitrary order.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This function can be slow (linear time), because QHash's internal data structure is optimized for fast lookup by key, not by value.
Definition at line 661 of file qhash.h.
|
inline |
Returns true if other is not equal to this hash; otherwise returns false.
Two hashes are considered equal if they contain the same (key, value) pairs.
This function requires the value type to implement operator==()
.
Q_INLINE_TEMPLATE QHash< Key, T > & QHash< Key, T >::operator= | ( | const QHash< Key, T > & | other | ) |
Assigns other to this hash and returns a reference to this hash.
Definition at line 591 of file qhash.h.
Q_OUTOFLINE_TEMPLATE bool QHash< Key, T >::operator== | ( | const QHash< Key, T > & | other | ) | const |
Returns true if other is equal to this hash; otherwise returns false.
Two hashes are considered equal if they contain the same (key, value) pairs.
This function requires the value type to implement operator==()
.
Definition at line 898 of file qhash.h.
Q_INLINE_TEMPLATE T & QHash< Key, T >::operator[] | ( | const Key & | key | ) |
Returns the value associated with the key as a modifiable reference.
If the hash contains no item with the key, the function inserts a default-constructed value into the hash with the key, and returns a reference to it. If the hash contains multiple items with the key, this function returns a reference to the most recently inserted value.
Definition at line 738 of file qhash.h.
Q_INLINE_TEMPLATE const T QHash< Key, T >::operator[] | ( | const Key & | key | ) | const |
Same as value().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 732 of file qhash.h.
Q_OUTOFLINE_TEMPLATE int QHash< Key, T >::remove | ( | const Key & | key | ) |
Removes all the items that have the key from the hash.
Returns the number of items removed which is usually 1 but will be 0 if the key isn't in the hash, or greater than 1 if insertMulti() has been used with the key.
Definition at line 784 of file qhash.h.
Referenced by QPatternist::GenericNamespaceResolver::addBinding(), QPatternist::DelegatingNamespaceResolver::addBinding(), QStateMachinePrivate::applyProperties(), QGestureManager::cleanupCachedGestures(), QGestureManager::cleanupGesturesForRemovedRecognizer(), QCoreGraphicsPaintEngine::clearColorSpace(), QPrintDialogPrivate::closeCarbonPrintPanel(), QGestureManager::filterEventThroughContexts(), QPMCache::insert(), QFSFileEnginePrivate::longFileName(), QDeclarativeEngineDebugPrivate::message(), QPMCache::object(), QMultiHash< const QGLContext *, GLProgram >::operator+(), QStyleSheetStyle::polish(), qt_dispatchTabletProximityEvent(), qt_x11_set_fallback_font_family(), QInotifyFileSystemWatcherEngine::readFromInotify(), QDeclarativeEngineDebugPrivate::remove(), QProcessEnvironment::remove(), QSet< typename TokenLookupClass::NodeName >::remove(), QPMCache::remove(), QDomDocumentTypePrivate::removeChild(), QBBEngine::removeConfiguration(), Graph< AnchorVertex, AnchorData >::removeDirectedEdge(), QNetworkAccessCache::removeEntry(), QGraphicsAnchorLayoutPrivate::removeInternalVertex(), QGraphicsScenePrivate::removeItemHelper(), QWindowsFileSystemWatcherEngine::removePaths(), QWSPropertyManager::removeProperties(), QWSPropertyManager::removeProperty(), QFont::removeSubstitution(), QDirectFbInput::removeWindow(), QDomDocumentTypePrivate::replaceChild(), QGraphicsAnchorLayoutPrivate::restoreSimplifiedConstraints(), QKqueueFileSystemWatcherEngine::run(), QWindowsFileSystemWatcherEngineThread::run(), QJSDebuggerAgent::scriptUnload(), QNetworkRequest::setAttribute(), QNetworkAccessBackend::setAttribute(), QAuServerNAS::setDone(), QNetworkSessionPrivateImpl::setSessionProperty(), QDesktopServices::setUrlHandler(), QAuServerNAS::soundDestroyed(), QNetworkAccessCache::timerEvent(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::unlink(), QFSFileEnginePrivate::unmap(), QStyleSheetStyle::unpolish(), QStateMachinePrivate::unregisterEventTransition(), QGestureManager::unregisterGestureRecognizer(), QStateMachinePrivate::unregisterSignalTransition(), QEventDispatcherWin32::unregisterSocketNotifier(), QStyleSheetStyle::unsetPalette(), updateWidgets(), QConfFileSettingsPrivate::~QConfFileSettingsPrivate(), QDeclarativePackageAttached::~QDeclarativePackageAttached(), QDeclarativePixmapReader::~QDeclarativePixmapReader(), QDeclarativeXmlQueryEngine::~QDeclarativeXmlQueryEngine(), and QMenuPrivate::QMacMenuPrivate::~QMacMenuPrivate().
Q_INLINE_TEMPLATE void QHash< Key, T >::reserve | ( | int | size | ) |
Ensures that the QHash's internal hash table consists of at least size buckets.
This function is useful for code that needs to build a huge hash and wants to avoid repeated reallocation. For example:
Ideally, size should be slightly more than the maximum number of items expected in the hash. size doesn't have to be prime, because QHash will use a prime number internally anyway. If size is an underestimate, the worst that will happen is that the QHash will be a bit slower.
In general, you will rarely ever need to call this function. QHash's internal hash table automatically shrinks or grows to provide good performance without wasting too much memory.
Definition at line 846 of file qhash.h.
Referenced by QPatternist::AccelTree::AccelTree(), QPatternist::BasicTypesFactory::BasicTypesFactory(), QPatternist::XQueryTokenizer::charForReference(), QPatternist::XSLTTokenizer::createElementDescriptions(), QPatternist::GenericStaticContext::GenericStaticContext(), QPatternist::NamePool::NamePool(), QXmlSerializerPrivate::QXmlSerializerPrivate(), QSet< typename TokenLookupClass::NodeName >::reserve(), and QPatternist::XsdSchemaTypesFactory::XsdSchemaTypesFactory().
|
inline |
Definition at line 305 of file qhash.h.
Referenced by QSet< typename TokenLookupClass::NodeName >::setSharable().
|
inline |
Returns the number of items in the hash.
Definition at line 295 of file qhash.h.
Referenced by QCache< QPixmapCache::Key, QPixmapCacheEntry >::count(), QApplication::font(), QTextFormatCollection::indexForFormat(), QProcessEnvironmentPrivate::keys(), operator<<(), QHash< QExplicitlySharedDataPointer, QHash >::operator==(), QApplication::palette(), qPRCleanup(), QApplication::setFont(), QApplicationPrivate::setPalette_helper(), QSet< typename TokenLookupClass::NodeName >::size(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::size(), and QProcessEnvironmentPrivate::toList().
|
inline |
Reduces the size of the QHash's internal hash table to save memory.
The sole purpose of this function is to provide a means of fine tuning QHash's memory usage. In general, you will rarely ever need to call this function.
Definition at line 301 of file qhash.h.
Referenced by QSet< typename TokenLookupClass::NodeName >::squeeze().
Swaps hash other with this hash.
This operation is very fast and never fails.
Definition at line 290 of file qhash.h.
Referenced by QSet< typename TokenLookupClass::NodeName >::swap(), and QMultiHash< const QGLContext *, GLProgram >::swap().
Q_OUTOFLINE_TEMPLATE T QHash< Key, T >::take | ( | const Key & | key | ) |
Removes the item with the key from the hash and returns the value associated with it.
If the item does not exist in the hash, the function simply returns a default-constructed value. If there are multiple items for key in the hash, only the most recently inserted one is removed.
If you don't use the return value, remove() is more efficient.
Definition at line 807 of file qhash.h.
Referenced by QStateMachinePrivate::_q_animationFinished(), QGraphicsAnchorLayoutPrivate::addAnchorMaybeParallel(), QSqlDatabasePrivate::addDatabase(), QStateMachinePrivate::applyProperties(), QGLGlyphCache::cleanupContext(), QNetworkManagerEngine::deviceRemoved(), QGLGlyphCache::fontEngineDestroyed(), QScriptDebuggerPrivate::handleResponse(), QDeclarativeGridView::itemsMoved(), QDeclarativeListView::itemsMoved(), QDeclarativeDataLoader::networkReplyFinished(), QDeclarativePixmapReader::networkRequestDone(), QAxScriptManager::objectDestroyed(), QFreetypeFace::release(), QDBusConnectionManager::removeConnection(), QSqlDatabasePrivate::removeDatabase(), QInotifyFileSystemWatcherEngine::removePaths(), QKqueueFileSystemWatcherEngine::removePaths(), QDeclarativeWatcher::removeWatch(), QSimplex::simplifyConstraints(), and QEventDispatcherMac::unregisterTimer().
Q_OUTOFLINE_TEMPLATE QList< Key > QHash< Key, T >::uniqueKeys | ( | ) | const |
Returns a list containing all the keys in the map.
Keys that occur multiple times in the map (because items were inserted with insertMulti(), or unite() was used) occur only once in the returned list.
Definition at line 628 of file qhash.h.
Q_INLINE_TEMPLATE QHash< Key, T > & QHash< Key, T >::unite | ( | const QHash< Key, T > & | other | ) |
Inserts all the items in the other hash into this hash.
If a key is common to both hashes, the resulting hash will contain the key multiple times.
Definition at line 556 of file qhash.h.
Referenced by QPatternist::XsdSchemaChecker::addComponentLocationHash(), QPatternist::XsdSchemaResolver::addComponentLocationHash(), and QPatternist::XsdParticleChecker::subsumes().
Q_INLINE_TEMPLATE const T QHash< Key, T >::value | ( | const Key & | key | ) | const |
Returns the value associated with the key.
If the hash contains no item with the key, the function returns a default-constructed value. If there are multiple items for the key in the hash, the value of the most recently inserted one is returned.
Definition at line 606 of file qhash.h.
Referenced by QStateMachinePrivate::_q_animationFinished(), QNetworkReplyImplPrivate::_q_copyReadyRead(), QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsAboutToBeRemoved(), QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsDataChanged(), QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsInserted(), QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished(), QEventDispatcherMacPrivate::activateTimer(), QNetworkManagerEngine::activeConnectionPropertiesChanged(), QSvgIconEngine::actualSize(), QMenuPrivate::QMacMenuPrivate::addAction(), MetaObjectGenerator::addChangedSignal(), QPdfEnginePrivate::addConstantAlphaObject(), QPdfEnginePrivate::addImage(), QGraphicsAnchorLayoutPrivate::addInternalVertex(), QWindowsFileSystemWatcherEngine::addPaths(), FlatListModel::addValue(), Graph< AnchorVertex, AnchorData >::adjacentVertices(), QPMCache::allPixmaps(), QNetworkReplyImplPrivate::appendDownstreamDataSignalEmissions(), QStateMachinePrivate::applyProperties(), QScriptEngineAgentPrivate::atStatement(), QDeclarativeMetaType::attachedPropertiesFuncId(), QNetworkRequest::attribute(), QPatternist::XsdInstanceReader::attribute(), QStyleSheetStyleSelector::attribute(), QDeclarativePath::attributeAt(), QPatternist::XsdInstanceReader::attributeItem(), QGraphicsAnchorLayoutPrivate::calculateGraphs(), QGestureManager::cancelGesturesForChildren(), QPatternist::XQueryTokenizer::charForReference(), QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdTypeChecker::checkConstrainingFacetsBinary(), QPatternist::XsdTypeChecker::checkConstrainingFacetsBoolean(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDateTime(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDecimal(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDouble(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDuration(), QPatternist::XsdTypeChecker::checkConstrainingFacetsList(), QPatternist::XsdTypeChecker::checkConstrainingFacetsNotation(), QPatternist::XsdTypeChecker::checkConstrainingFacetsQName(), QPatternist::XsdTypeChecker::checkConstrainingFacetsSignedInteger(), QPatternist::XsdTypeChecker::checkConstrainingFacetsString(), QPatternist::XsdTypeChecker::checkConstrainingFacetsUnion(), QPatternist::XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QGestureManager::cleanupGesturesForRemovedRecognizer(), QGtkStylePrivate::cleanupGtkWidgets(), QCoreGraphicsPaintEngine::cleanUpMacColorSpaces(), QPatternist::ColorOutput::colorify(), QPatternist::ColoringMessageHandler::colorifyDescription(), EGLNullWSScreen::connect(), QDBusConnectionManager::connection(), QScriptEnginePrivate::convertValue(), convertWithPalette(), QScriptEnginePrivate::create(), Graph< AnchorVertex, AnchorData >::createDirectedEdge(), QDBusMetaObject::createMetaObject(), QPatternist::XsdSchemaTypesFactory::createSchemaType(), QPatternist::BasicTypesFactory::createSchemaType(), QDeclarativeMetaType::customStringConverter(), QDeclarativeTypeNameCache::data(), QSqlDatabasePrivate::database(), QScriptEnginePrivate::defaultPrototype(), QScriptDebuggerAgent::deleteBreakpoint(), QGestureManager::deliverEvents(), derivedTermValid(), QScriptEngineAgentPrivate::didReachBreakpoint(), QAuthenticatorPrivate::digestMd5Response(), QAxMetaObject::dispIDofName(), QMacStyle::drawControl(), QPdfBaseEnginePrivate::drawTextItem(), Graph< AnchorVertex, AnchorData >::edgeData(), QPatternist::AccelTree::elementById(), QDeclarativePath::endpoint(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::epsilonClosure(), familyNameFromPostScriptName(), QNetworkAccessHttpBackend::fetchCacheMetaData(), QWSPropertyManager::Data::find(), QWidget::find(), QDBusConnectionPrivate::findMetaObject(), QAxScript::findObject(), QGraphicsAnchorLayoutPrivate::findPaths(), QNetworkReplyImplPrivate::finished(), QPMCache::flushDetachedPixmaps(), QApplication::font(), QConfFile::fromName(), QGraphicsScenePrivate::gestureEventHandler(), QDeclarativeTypeLoader::get(), QRegExpEngine::getEscape(), QFreetypeFace::getFace(), QGestureManager::getGestureTargets(), QBBEngine::getInterfaceFromId(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertySlot(), getPath(), QWSPropertyManager::getProperty(), QDeclarativeTypeLoader::getQmldir(), QDeclarativeTypeLoader::getScript(), QSharedNetworkSessionManager::getSession(), QGestureManager::getState(), QComboMenuDelegate::getStyleOption(), QGtkStylePrivate::gtkWidget(), QDirectFbInput::handleEnterLeaveEvents(), QStateMachinePrivate::handleFilteredEvent(), QDirectFbInput::handleKeyEvents(), QDirectFbInput::handleMouseEvents(), QDBusConnectionPrivate::handleSignal(), QDirectFbInput::handleWheelEvent(), hasDuplicatedElementsInternal(), QTextFormatCollection::hasFormatCached(), QSqlResult::hasOutValues(), QDeclarativePackage::hasPart(), QWSPropertyManager::hasProperty(), QStyleSheetStyle::hasStyleRule(), QNetworkRequest::header(), QmlJSDebugger::AbstractViewInspector::idStringForObject(), QTextFormatCollection::indexForFormat(), QMacPrintEnginePrivate::initialize(), QPMCache::insert(), QProcessEnvironmentPrivate::insert(), QDeclarativeXmlQueryEngine::instance(), QDeclarativeMetaType::interfaceIId(), QDeclarativePath::interpolate(), QSimplexConstraint::invert(), QAxServerBase::Invoke(), QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(), QSimplexConstraint::isSatisfied(), QPatternist::XsdParticleChecker::isUPAConform(), QPatternist::XsdSchemaHelper::isValidAttributeUsesRestriction(), QDeclarativeMetaType::listType(), QPatternist::GenericDynamicContext::locationFor(), QPatternist::GenericStaticContext::locationFor(), QReadWriteLock::lockForRead(), QPatternist::GenericNamespaceResolver::lookupNamespaceURI(), QPatternist::DelegatingNamespaceResolver::lookupNamespaceURI(), QScript::QObjectDelegate::markChildren(), QMenuPrivate::QMacMenuPrivate::merged(), QDeclarativeEngineDebugPrivate::message(), QDeclarativeVMEMetaObject::metaCall(), QNetworkReplyImplPrivate::metaDataChanged(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::move(), QSvgTinyDocument::namedNode(), QSvgTinyDocument::namedStyle(), QPatternist::AccelTree::namespaceBindings(), QDeclarativeDataLoader::networkReplyProgress(), QPatternist::XsdTypeChecker::normalizedValue(), QAxMetaObject::numParameter(), QPMCache::object(), QPatternist::AccelTreeResourceLoader::openUnparsedText(), operator<<(), QHash< QExplicitlySharedDataPointer, QHash >::operator[](), QAuthenticator::option(), QAxMetaObject::paramType(), QAuthenticatorPrivate::parseDigestAuthenticationChallenge(), QPatternist::PatternPlatform::parseFlags(), QAuthenticatorPrivate::parseHttpResponse(), parseServerList(), QDeclarativePackage::part(), QSvgIconEngine::pixmap(), QJSDebuggerAgentPrivate::positionChange(), QPrintDialogPrivate::printDialogSheetDoneCallback(), QPatternist::AccelTree::printStats(), QPatternist::XsdStateMachine< XsdSchemaToken::NodeName >::proceed(), QPatternist::NamespaceSupport::processName(), QDeclarativePath::processPath(), FlatListScriptClass::property(), QDeclarativePropertyCache::property(), QScript::QObjectDelegate::put(), qDBusRemoveWatch(), qmlAttachedPropertiesObjectById(), QDeclarativeMetaType::qmlType(), qPRFindWidget(), qt_aqua_get_known_size(), qt_fallback_font_family(), qt_internal_proc(), qt_mac_handleTabletEvent(), qt_mac_set_modal_state(), qt_mac_socket_callback(), QAxServerBase::qt_metacall(), QtWndProc(), QSvgIconEngine::read(), MetaObjectGenerator::readEnumInfo(), MetaObjectGenerator::readEventInfo(), MetaObjectGenerator::readEventInterface(), QInotifyFileSystemWatcherEngine::readFromInotify(), QGestureManager::recycle(), QPMCache::remove(), QGraphicsAnchorLayoutPrivate::removeAnchor(), Graph< AnchorVertex, AnchorData >::removeDirectedEdge(), QGraphicsAnchorLayoutPrivate::removeInternalVertex(), QWindowsFileSystemWatcherEngine::removePaths(), QPatternist::XsdSchemaResolver::resolveEnumerationFacetValues(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QDialogButtonBoxPrivate::retranslateStrings(), QPatternist::ConstructorFunctionsFactory::retrieveFunctionSignature(), QPatternist::FunctionFactoryCollection::retrieveFunctionSignature(), QKqueueFileSystemWatcherEngine::run(), QWindowsFileSystemWatcherEngineThread::run(), QAxScriptManager::script(), QMenuPrivate::scrollMenu(), QSqlRelationalTableModel::selectStatement(), QNetworkAccessCacheBackend::sendCacheContents(), QNetworkAccessHttpBackend::sendCacheContents(), QPatternist::AccelTree::sendNamespaces(), QEventDispatcherWin32Private::sendTimerEvent(), QNetworkSessionPrivateImpl::sessionProperty(), QNetworkManagerEngine::sessionStateForId(), QSimplex::setConstraints(), QMenuPrivate::setCurrentAction(), QScriptEnginePrivate::setDefaultPrototype(), QTextControl::setExtraSelections(), ModelNode::setObjectValue(), QWSPropertyManager::setProperty(), FlatListScriptClass::setProperty(), QSimplex::simplifyConstraints(), QSimplex::solver(), QPatternist::XsdSchemaChecker::sourceLocation(), QPatternist::AccelTree::sourceLocation(), QPatternist::XsdSchemaResolver::sourceLocation(), QPatternist::AccelTree::stringValue(), QRenderRule::styleHint(), QStyleSheetStyle::styleRules(), QMacStyle::subControlRect(), QStyleSheetStyle::subControlRect(), QFont::substitutes(), QPatternist::XsdParticleChecker::subsumes(), QDBusConnectionPrivate::timerEvent(), QDockWidgetLayout::titleHeight(), QSimplexConstraint::toString(), MetaObjectGenerator::tryCache(), QReadWriteLock::tryLockForRead(), QPatternist::XsdSchema::type(), QReadWriteLock::unlock(), QPatternist::NamePool::unlockedAllocateLocalName(), QPatternist::NamePool::unlockedAllocateNamespace(), QPatternist::NamePool::unlockedAllocatePrefix(), QFSFileEnginePrivate::unmap(), QStateMachinePrivate::unregisterEventTransition(), QGestureManager::unregisterGestureRecognizer(), QEventDispatcherWin32::unregisterSocketNotifier(), QStyleSheetStyle::unsetPalette(), QMenuPrivate::updateActionRects(), QBBButtonEventNotifier::updateButtonStates(), QPatternist::NamespaceSupport::uri(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), QDeclarativeIntegerCache::value(), QSvgIconEngine::write(), and QGestureManager::~QGestureManager().
Q_INLINE_TEMPLATE const T QHash< Key, T >::value | ( | const Key & | key, |
const T & | defaultValue | ||
) | const |
If the hash contains no item with the given key, the function returns defaultValue.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 617 of file qhash.h.
Q_OUTOFLINE_TEMPLATE QList< T > QHash< Key, T >::values | ( | ) | const |
Returns a list containing all the values in the hash, in an arbitrary order.
If a key is associated multiple values, all of its values will be in the list, and not just the most recently inserted one.
The order is guaranteed to be the same as that used by keys().
Definition at line 693 of file qhash.h.
Referenced by QPatternist::XsdSchema::anonymousTypes(), QStateMachinePrivate::applyProperties(), ModelNode::clear(), QPatternist::XsdSchema::complexTypes(), QGraphicsAnchorLayoutPrivate::constraintsFromPaths(), QIcdEngine::doRequestUpdate(), QTextDocumentLayoutPrivate::drawTableCell(), QTextLine::glyphs(), QTextDocumentLayoutPrivate::hitTest(), QTextDocumentLayoutPrivate::layoutCell(), QDeclarativeMetaType::qmlType(), QDeclarativeMetaType::qmlTypes(), shiftConstraints(), QPatternist::XsdSchema::simpleTypes(), QPatternist::XsdSchema::types(), QDeclarativeSmoothedAnimationPrivate::updateRunningAnimations(), QPatternist::XsdSchemaResolver::XsdSchemaResolver(), and QDeclarativePixmapReader::~QDeclarativePixmapReader().
Q_OUTOFLINE_TEMPLATE QList< T > QHash< Key, T >::values | ( | const Key & | key | ) | const |
Returns a list of all the values associated with the key, from the most recently inserted to the least recently inserted.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 706 of file qhash.h.
|
friend |
|
related |
Writes the hash hash to stream out.
This function requires the key and value types to implement operator<<()
.
Definition at line 376 of file qdatastream.h.
|
related |
Reads a hash from stream in into hash.
This function requires the key and value types to implement operator>>()
.
Definition at line 349 of file qdatastream.h.
Returns the hash value for the key.
Types T1
and T2
must be supported by qHash().
Definition at line 105 of file qhash.h.
|
related |
Returns the hash value for the key.
Definition at line 62 of file qhash.h.
Returns the hash value for the key.
Definition at line 63 of file qhash.h.
|
related |
Returns the hash value for the key.
Definition at line 64 of file qhash.h.
Returns the hash value for the key.
Definition at line 65 of file qhash.h.
|
related |
Returns the hash value for the key.
Definition at line 66 of file qhash.h.
Returns the hash value for the key.
Definition at line 67 of file qhash.h.
|
related |
Returns the hash value for the key.
Definition at line 68 of file qhash.h.
Returns the hash value for the key.
Definition at line 69 of file qhash.h.
|
related |
Returns the hash value for the key.
Definition at line 77 of file qhash.h.
Returns the hash value for the key.
Definition at line 78 of file qhash.h.
Returns the hash value for the key.
Definition at line 86 of file qhash.h.
Returns the hash value for the key.
Definition at line 87 of file qhash.h.
Returns the hash value for the key.
Definition at line 97 of file qhash.cpp.
|
related |
Returns the hash value for the key.
Definition at line 97 of file qhash.h.
|
related |
Computes a hash key from the QXmlNodeModelIndex index, and returns it.
This function would be used by QHash if you wanted to build a hash table for instances of QXmlNodeModelIndex.
The hash is computed on QXmlNodeModelIndex::data(), QXmlNodeModelIndex::additionalData(), and QXmlNodeModelIndex::model(). This means the hash key can be used for node indexes from different node models.
Definition at line 1447 of file qabstractxmlnodemodel.cpp.
union { ... } |
Definition at line 264 of file qhash.h.
Referenced by QHash< QExplicitlySharedDataPointer, QHash >::isSharedWith(), QHash< QExplicitlySharedDataPointer, QHash >::operator=(), QHash< QExplicitlySharedDataPointer, QHash >::operator==(), qt_create_commandline(), QHash< QExplicitlySharedDataPointer, QHash >::swap(), and QHash< QExplicitlySharedDataPointer, QHash >::~QHash().