Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to populate a QML List with QStrings from C++ using signals?
Forum Updated to NodeBB v4.3 + New Features

How to populate a QML List with QStrings from C++ using signals?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 1.2k Views 2 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.
  • R Offline
    R Offline
    RyonMS
    wrote on last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by jpnurmi
      #2

      If you want to manipulate the model from C++, it would make sense to use a C++ model instead of QML ListModel. For example, if you need nothing else but a list of strings, you could use QStringListModel.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RyonMS
        wrote on last edited by
        #3

        Okay so if have a QStringListModel in C++ and I populate it intermittently with strings supplied by some function, how can attach the QStringListModel to the ListView in QML?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by A Former User
          #4

          Hi! There is an nice explanation of how to use QStringList-based models: Using C++ Models with Qt Quick Views.

          1 Reply Last reply
          1

          • Login

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