Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    How do I place XML data in a Selection Dialog

    QML and Qt Quick
    1
    1
    909
    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.
    • H
      honeyhong last edited by

      "Example Selection Dialog":http://i214.photobucket.com/albums/cc71/honeyhong/Capture-1.jpg

      I have a Selection Dialog like the one in the picture I attached.
      The data in the selection dialog were preset like this.

      @
      SelectionDialog
      {
      id:root
      titleText:"Select a Box"
      model:ListModel
      {
      ListElement { name: "Inbox"; boxId: 0}
      ListElement { name: "Today"; boxId: 1}
      ListElement { name: "Next"; boxId: 2}
      ListElement { name: "Later"; boxId: 3}
      }

      delegate: itemDelegate
      Component {
      id: itemDelegate
      MenuItem {
      text: model.name
      onClicked: {
      selectedIndex = index;
      root.accept();
      }
      }
      }
      

      } //close
      @

      Right now, I want to retrieve an XML data and display it in the selection dialog instead of setting it manually by myself.
      My XML data is this

      @
      XmlListModel {
      id: photo1
      property string feedUrl: ""
      property bool loading: status == XmlListModel.Loading

                  source: "(_example url_)"
                  query: "/plist/array/dict"
                  XmlRole { name: "photoTitle"; query: "string[1]/string()";}
             }
              }
      

      @
      To be clearer, instead of keying in Inbox, Today etc. by myself into the Selection Dialog,
      I want to retrieve the XML data that display item e.g(October, November, December) into the Selection Dialog.
      Any idea how to do it? Really need help.

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