Logo Search packages:      
Sourcecode: qt4-x11 version File versions

template<class Key, class T>
Q_OUTOFLINE_TEMPLATE QList< Key > QHash< Key, T >::keys (  )  const [inline, inherited]

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().

See also:
uniqueKeys(), values(), key()

Definition at line 585 of file qhash.h.

References QList< T >::append(), QHash< Key, T >::begin(), QHash< Key, T >::end(), and QHash< Key, T >::const_iterator::key().

Referenced by QAbstractFormBuilder::computeProperties().

{
    QList<Key> res;
    const_iterator i = begin();
    while (i != end()) {
        res.append(i.key());
        ++i;
    }
    return res;
}


Generated by  Doxygen 1.6.0   Back to index