Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QVariantMap Question

    Mobile and Embedded
    1
    1
    831
    Loading More Posts
    • 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.
    • B
      barrentf last edited by

      I'm developing natively on the blackberry 10 in c++, I've turned an XML file into the following QVariantMap:

      @
      QMap(
      ("_MoreStuff", QVariant
      (QVariantList,
      (QVariant
      (QVariantMap, QMap
      (("stuffID", QVariant(QString, "1") )
      ( "stuffValue" , QVariant(QString, "I want this value 1") ) )
      ) ,
      QVariant
      (QVariantMap, QMap
      (("stuffID", QVariant(QString, "2") )
      ( "stuffValue" , QVariant(QString, "I want this value 2") ) )
      ) ,
      QVariant(
      QVariantMap, QMap
      (("stuffID", QVariant(QString, "3") )
      ( "stuffValue" , QVariant(QString, "I want this value 3") ) )
      ) ...
      @

      I want to search for stuffID of value 2 for instance and get the associated stuffValue of "I want this value 2"
      Anyone know how to do this, or point me in the direction of helpful documentation?

      I'm having trouble just pulling the Qmap apart, like
      QList<QVariant> languagelist = datamap.value("_MoreStuff").toList(); is just giving me errors.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post