Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QListWidget Iterating



  • It concerns me a bit when I see "list" in the name and all I can find are examples such as this:

    @
    QListWidget* list; // initialized else where

    for(int i = 0; i < list->count(); i++){
    list->item(i); // do something
    }
    @

    If QListWidget is using a linked list than this bit of code is redundant. I was hoping someone can confirm this for me.



  • No, QListWidget doesn't use linked list, it uses model-view architecture. If you don't specify model it creates QListModel implicitly.


Log in to reply