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. Put QMap values in a QListView
Forum Updated to NodeBB v4.3 + New Features

Put QMap values in a QListView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 311 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.
  • SteMMoS Offline
    SteMMoS Offline
    SteMMo
    wrote on last edited by SteMMo
    #1

    Hi,
    I need to show in a QListView the data contained in a QMap<QString, QString> object: this data are read from a database (C++ side).
    I'd like to show in a tabular mode the list of <key> and <value> values - they are the settings of the program.

    I'm wondering:

    1. QMap is suitable for the model of the QListView?
    2. how can access to the QMap elements?
    3. in general, how can i access to the QMap elements on the QML side?

    Thanks, regards

    ODБOïO 1 Reply Last reply
    0
    • SteMMoS SteMMo

      Hi,
      I need to show in a QListView the data contained in a QMap<QString, QString> object: this data are read from a database (C++ side).
      I'd like to show in a tabular mode the list of <key> and <value> values - they are the settings of the program.

      I'm wondering:

      1. QMap is suitable for the model of the QListView?
      2. how can access to the QMap elements?
      3. in general, how can i access to the QMap elements on the QML side?

      Thanks, regards

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @SteMMo hi
      this is the recommended way of using C++ Models with Qt Quick Views

      1 Reply Last reply
      0

      • Login

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