Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Difference between List View and List Widget?
Forum Updated to NodeBB v4.3 + New Features

Difference between List View and List Widget?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 20.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sprezzatura
    wrote on 17 Sept 2018, 14:25 last edited by
    #1

    What is the difference between a List View and a List Widget?

    If I'm converting a Visual Studio List Box in a dialog, which one should I use (View or Widget)?

    M 1 Reply Last reply 17 Sept 2018, 14:46
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 17 Sept 2018, 14:41 last edited by
      #2

      Isn't the documentation clear enough? http://doc.qt.io/qt-5/qlistwidget.html#details

      QListWidget is a convenience class that provides a list view similar to the one supplied by QListView, but with a classic item-based interface for adding and removing items. QListWidget uses an internal model to manage each QListWidgetItem in the list.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • S Sprezzatura
        17 Sept 2018, 14:25

        What is the difference between a List View and a List Widget?

        If I'm converting a Visual Studio List Box in a dialog, which one should I use (View or Widget)?

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 17 Sept 2018, 14:46 last edited by
        #3

        @Sprezzatura

        • If I'm converting a Visual Studio List Box in a dialog, which one should I use (View or Widget)?

        Well the ListWidget resembles more how a traditional listbox works.
        That said, using a model ( ListView) allows for automatic updates to the model
        if the Data in the listbox changes. This can be very handy if the data represented in the
        "listbox" is shared/replicated among other widgets.
        If you already have such synchronization in place, or the data is not shared,
        ListWidget might be the fastest route for conversion.
        So I would say it mostly depends on the way the listbox data is used/shared/what it represents.

        1 Reply Last reply
        6
        • S Offline
          S Offline
          Sprezzatura
          wrote on 17 Sept 2018, 16:49 last edited by
          #4

          Thank you @mrjj for a useful answer, that's the kind of high-level overview answer I was looking for. I'm using a plain, ordinary list box where the items are displayed but not edited by the user.

          M 1 Reply Last reply 18 Sept 2018, 06:11
          0
          • S Sprezzatura
            17 Sept 2018, 16:49

            Thank you @mrjj for a useful answer, that's the kind of high-level overview answer I was looking for. I'm using a plain, ordinary list box where the items are displayed but not edited by the user.

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 18 Sept 2018, 06:11 last edited by
            #5

            @Sprezzatura
            hi
            well if the LB items are not shared with other structures / updated often, i would
            go with ListWidget as more changes to the code seems required to take full advantage of having a model.

            1 Reply Last reply
            2

            1/5

            17 Sept 2018, 14:25

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved