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. Set inner HTML using QDomDocument
Forum Updated to NodeBB v4.3 + New Features

Set inner HTML using QDomDocument

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.2k 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.
  • V Offline
    V Offline
    victor.osorio
    wrote on 3 May 2013, 12:24 last edited by
    #1

    How can I set the inner HTML in a QDomElement?

    When I'm using QWebElement I have the method "QWebElement::setInnerXml(const QString & markup)":http://qt-project.org/doc/qt-5.0/qtwebkit/qwebelement.html#setInnerXml, there is some similar method in QDomElement?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 3 May 2013, 12:37 last edited by
      #2

      and why don't you just use this method?!

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • V Offline
        V Offline
        victor.osorio
        wrote on 3 May 2013, 12:41 last edited by
        #3

        Because the both class are not related!

        The both class are used in different contexts. See doc of "QWebElement":http://qt-project.org/doc/qt-5.0/qtwebkit/qwebelement.html and "QDomElement":http://qt-project.org/doc/qt-5.0/qtxml/qdomelement.html

        [quote author="raven-worx" date="1367584646"]and why don't you just use this method?![/quote]

        1 Reply Last reply
        0
        • R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 3 May 2013, 12:45 last edited by
          #4

          sorry... seems my brain wasn't completely present :)

          QDomElement inherits QDomNode which holds all methods you need.
          You first "remove":http://qt-project.org/doc/qt-4.8/qdomnode.html#removeChild all "children ":http://qt-project.org/doc/qt-4.8/qdomnode.html#childNodesand then "append":http://qt-project.org/doc/qt-4.8/qdomnode.html#appendChild the newly created QDomElement into it.

          QDomNode API isn't that handy in this case. You have to create all child nodes by yourself...

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • V Offline
            V Offline
            victor.osorio
            wrote on 3 May 2013, 12:47 last edited by
            #5

            That was a bad news.... :P

            [quote author="raven-worx" date="1367585147"]sorry... seems my brain wasn't completely present :)

            QDomElement inherits QDomNode which holds all methods you need.
            You first remove all children and then "append":http://qt-project.org/doc/qt-4.8/qdomnode.html#appendChild the newly created QDomElement into it.

            QDomNode API isn't that handy in this case. You have to create all child nodes by yourself...[/quote]

            1 Reply Last reply
            0

            1/5

            3 May 2013, 12:24

            • Login

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