Qt Learning Summary (C Fish) QList and QMap container classes
QList
The QList container is an array list with the following characteristics:
1. You can use QList in most cases. For operations like prepend (), append (), and insert (), QList is usually much faster than QVector. This is because QList stores its element items in memory based on the index tag (although memory is not contiguous, which is the same as STL's list), it is faster than container classes that rely on iterator iterations, and you have less code.
two。 When an iterator points to an item in QList, if the QList inserts or deletes, the iterator is invalid.
The 3.QStringList class inherits from the QList container class (note that QList is actually a class template with QString types in it, and then a QStringList class inherits from it).
Simple use of the QList container (since QStringList inherits from QList, all of the following uses apply equally to the QStringList container):
# include#include # includeint main (int argc, char * argv []) {QCoreApplication a (argc, argv); QList list;// creates a QList container that stores data of type QString inside the container and returns a list object that has many methods to manipulate the container. List