Posts

Qt Containers - Lists

I selected this topic due to it's scope and unawareness in new programmers and there is no exception for new Qt programmers as well. Containers, as the name defines, are those structures that are specially designed to hold the data. After holding it, it allows certain operations, not to manipulate it, but to arrange it in specific order and provides accessibility to it. Qt has several built-in containers. The good point of Qt Container classes is that it allows conversion to STL Container classes and also overloaded operators for easy usage. Let's discuss few of Container classes in Qt: 1. QList<T> You can consider it like a dynamic array. It allows access to data from both sides and also by the index, like an array. It allows converting to QVector<T> and STL vectors as well. When its object is initialized, it pre-allocate the space of its data. It has good performance in prepend() and append() operations.  QList<int> lst; lst.append(5); lst.a...