|
| QQueue () = default |
|
| ~QQueue () = default |
|
T | dequeue () |
|
void | enqueue (const T &value) |
|
void | enqueue (T &&value) |
|
T & | head () |
|
const T & | head () const |
|
void | swap (QQueue< T > &other) |
|
| QList () = default |
|
| QList (const QList< T > &other) = default |
|
template<class Input_Iterator > |
| QList (Input_Iterator first, Input_Iterator last) |
|
| QList (QList< T > &&other) = default |
|
| QList (std::initializer_list< T > args) |
|
| ~QList () = default |
|
void | append (const QList< T > &other) |
|
void | append (const T &value) |
|
void | append (QList< T > &&other) |
|
void | append (T &&value) |
|
const T & | at (size_type i) const |
|
T & | back () |
|
const T & | back () const |
|
iterator | begin () |
|
const_iterator | begin () const |
|
const_iterator | cbegin () const |
|
const_iterator | cend () const |
|
void | clear () |
|
const_iterator | constBegin () const |
|
const_iterator | constEnd () const |
|
const_reference | constFirst () const |
|
const_reference | constLast () const |
|
bool | contains (const T &value) const |
|
size_type | count () const |
|
size_type | count (const T &value) const |
|
const_reverse_iterator | crbegin () const |
|
const_reverse_iterator | crend () const |
|
bool | empty () const |
|
iterator | end () |
|
const_iterator | end () const |
|
bool | endsWith (const T &value) const |
|
iterator | erase (const_iterator begin, const_iterator end) |
|
iterator | erase (const_iterator pos) |
|
T & | first () |
|
const T & | first () const |
|
T & | front () |
|
const T & | front () const |
|
size_type | indexOf (const T &value, size_type from=0) const |
|
iterator | insert (iterator before, const T &value) |
|
void | insert (size_type i, const T &value) |
|
bool | isEmpty () const |
|
T & | last () |
|
const T & | last () const |
|
size_type | lastIndexOf (const T &value, size_type from=-1) const |
|
size_type | length () const |
|
QList< T > | mid (size_type pos, size_type length=-1) const |
|
void | move (size_type from, size_type to) |
|
bool | operator!= (const QList< T > &other) const |
|
QList< T > | operator+ (const QList< T > &other) const |
|
QList< T > & | operator+= (const QList< T > &other) |
|
QList< T > & | operator+= (const T &value) |
|
QList< T > & | operator<< (const QList< T > &other) |
|
QList< T > & | operator<< (const T &value) |
|
QList< T > & | operator= (const QList< T > &other) = default |
|
QList< T > & | operator= (QList< T > &&other) = default |
|
bool | operator== (const QList< T > &other) const |
|
T & | operator[] (size_type i) |
|
const T & | operator[] (size_type i) const |
|
void | pop_back () |
|
void | pop_front () |
|
void | prepend (const T &value) |
|
void | push_back (const T &value) |
|
void | push_front (const T &value) |
|
reverse_iterator | rbegin () |
|
const_reverse_iterator | rbegin () const |
|
size_type | removeAll (const T &value) |
|
void | removeAt (size_type i) |
|
void | removeFirst () |
|
void | removeLast () |
|
bool | removeOne (const T &value) |
|
reverse_iterator | rend () |
|
const_reverse_iterator | rend () const |
|
void | replace (size_type i, const T &value) |
|
void | resize (size_type size) |
|
size_type | size () const |
|
bool | startsWith (const T &value) const |
|
void | swap (QList< T > &other) |
|
void | swap (size_type i, size_type j) |
|
T | takeAt (size_type i) |
|
T | takeFirst () |
|
T | takeLast () |
|
QSet< T > | toSet () const |
|
std::list< T > | toStdList () const |
|
QVector< T > | toVector () const |
|
T | value (size_type i) const |
|
T | value (size_type i, const T &defaultValue) const |
|
template<class T>
class QQueue< T >
The QQueue class is a template class which provides a stack. This container implements a stack using a QVector. A queue is a first in, first out (FIFO) data structure. Items are added to the tail of the queue using enqueue() and retrieved from the head using dequeue().
For an overview and comparison of all containers, refer to the documentation for Container Classes. Refer to the section on Time Complexity for a discussion about which operations will be relatively faster or slower for a given container with a size of n.
Basic Operations
QQueue inherits from QList so all of the methods in QList are available.
The head() method provides access to the element which was added first, it does not remove it from the queue. To retrieve this element and also remove it, use dequeue(). Use the isEmpty() method to determine if the queue has any elements.
To traverse a QStack the QList iterators can be used.
Constraints on type T
The QQueue value type T should be Default Constructible and Copy Constructible to work with all methods of this class. Data types like QObject are not copy constructible and therefore should never be stored in a container. You can however use a pointer to a QObject or any subclass as the type T.
- See also
- QList, QStack