Please nominate your Qt Champions for 2021!

Put QMap values in a QListView

  • 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

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

Log in to reply