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 do I place XML data in a Selection Dialog

How do I place XML data in a Selection Dialog

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.0k Views
  • 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 Offline
    H Offline
    honeyhong
    wrote on last edited by
    #1

    "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
    0

    • Login

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