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. XmlListModel query returns wrong result?
Qt 6.11 is out! See what's new in the release blog

XmlListModel query returns wrong result?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 540 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.
  • DiracsbracketD Offline
    DiracsbracketD Offline
    Diracsbracket
    wrote on last edited by Diracsbracket
    #1
    This post is deleted!
    JonBJ 1 Reply Last reply
    0
    • DiracsbracketD Diracsbracket

      This post is deleted!

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @Diracsbracket

      Each <it> container can contain a different number of <si> elements.

      I don't understand: your <it> is not a container for <si> elements, it's a container for a <c> element which contains <si> elements.

      EDIT
      Maybe this is "terminology". I meant direct container, that's what it means to me. But I note now that your query is:
      /rm/bt/it[4]/c/si
      so you do have the c level in there.

      OK, let's be clear: your <it>s can only contain just one <c>?

      DiracsbracketD 1 Reply Last reply
      0
      • JonBJ JonB

        @Diracsbracket

        Each <it> container can contain a different number of <si> elements.

        I don't understand: your <it> is not a container for <si> elements, it's a container for a <c> element which contains <si> elements.

        EDIT
        Maybe this is "terminology". I meant direct container, that's what it means to me. But I note now that your query is:
        /rm/bt/it[4]/c/si
        so you do have the c level in there.

        OK, let's be clear: your <it>s can only contain just one <c>?

        DiracsbracketD Offline
        DiracsbracketD Offline
        Diracsbracket
        wrote on last edited by Diracsbracket
        #3

        @JonB
        Hi Jon,
        Thanks for your kind reply. I deleted my post before yours was visible.

        @JonB said in XmlListModel query returns wrong result?:

        your <it>s can only contain just one <c>

        Yes, well at least at that level.

        The reason I deleted my post is that I eventually got things sorted out, although I still don't really get why it didn't work.

        I realize that at first, I had <c> elements declared also within <si> sub-elements but given the structure of my query, I didn't think this should be a problem. The <c> elements represented a "code" element, some of which could consist of a sequence of "subcodes", which I again wrap inside a <c> container.

                <it>
                    <b>b_info</b>
        	    <c>
                        <si><d>d_info1</d><c>s_info1</c></si>
                        <si><d>d_info2</d><c>s_info2</c></si>
                        <si><d>d_info3</d><c>s_info3</c></si>
                    </c>
                    <i>i_info</i>
                </it>
        

        In any case, I modified the structure of my <it> element to the following in case of a composite code:

                <it>
                    <b>b_info</b>
        	    <s>
                        <si><d>d_info1</d><c>s_info1</c></si>
                        <si><d>d_info2</d><c>s_info2</c></si>
                        <si><d>d_info3</d><c>s_info3</c></si>
                    </s>
                    <i>i_info</i>
                </it>
        

        and for a simple code to:

                <it>
                    <b>b_info</b>
        	    <c> simple_code</c>
                    <i>i_info</i>
                </it>
        

        Using the above approach in addition makes it simpler to check if it is a composite code or not (/s and /c queries will be null/not null)...

        Thanks again!

        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