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

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.