Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]QDomDocument to QDomElement help needed
Forum Updated to NodeBB v4.3 + New Features

[Solved]QDomDocument to QDomElement help needed

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    SetBetterPass
    wrote on last edited by
    #1

    I have xmpp iq which I loaded from QByteArray to QDomDocument, but I need it as QDomElement

    @<iq from='users.netlab.cz' to='test_soc@jabbim.sk/QXmpp' id='search0' type='result'>
    <query >
    <instructions>You need an x:data capable client to search</instructions>
    <x type='form'>
    <title>Search users in users.netlab.cz</title>
    <instructions>blahblah</instructions>
    <field type='text-single' label='User' var='user'/>
    ...
    <field type='text-single' label='Organization Unit' var='orgunit'/>
    </x>
    </query>
    </iq>@

    so I just used

    @QDomElement element = doc.toElement();@

    but it returned no data, I am not really familiar with xml so I'm not really sure if this is right. Anyone can tell me how to convert this document to element or if its able to directly load data from QByteArray to QDomElement somehow?

    Thanks, Marek.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      steno
      wrote on last edited by
      #2

      You can use QDomDocument::documentElement() to get the root element of the document and go from there.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SetBetterPass
        wrote on last edited by
        #3

        yes this one works thanks:)

        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