Results 1 to 2 of 2

Thread: QDomNode replaceChild is not work

  1. #1
    Join Date
    Mar 2010
    Location
    Brasília, Brasil
    Posts
    15
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default QDomNode replaceChild is not work

    Hi,

    I'm trying to use the code below, but I have not had success. Could anyone help me?
    NewCode this object always null. : /

    Qt Code:
    1. QDomNode *oldNode = &this->documento.childNodes().at(2).childNodes().at(4).childNodes().at(0).childNodes().at(indiceLinhaAtual);
    2. QDomNode newNode = this->documento.childNodes().at(2).childNodes().at(4).childNodes().at(0).replaceChild( nodeAux, *oldNode);
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 6th December 2010 at 18:53. Reason: missing [code] tags

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDomNode replaceChild is not work

    Eh, what is the exact purpose of that piece of code?


    Added after 4 minutes:


    Never mind. QDomNode is explicitly shared. You don't need the pointer semantics:
    Qt Code:
    1. QDomNode oldNode = this->documento.childNodes().at(2).childNodes().at(4).childNodes().at(0).childNodes().at(indiceLinhaAtual );
    2. QDomNode newNode = this->documento.childNodes().at(2).childNodes().at(4).childNodes().at(0).replaceChild( nodeAux, oldNode);
    To copy to clipboard, switch view to plain text mode 
    Try that first. If that doesn't do what you want it to do, then explain here.

    And read through the QDomNode docs carefully (including the class description).
    Last edited by franz; 6th December 2010 at 18:00.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. QDomNode::replaceChild Question
    By KineticArc in forum Qt Programming
    Replies: 2
    Last Post: 22nd September 2010, 20:05
  2. Problem with Deleting QDomNode
    By metdos in forum Qt Programming
    Replies: 6
    Last Post: 16th July 2010, 19:58
  3. QDomNode
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 14th September 2007, 07:11
  4. QDomNode
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 6th September 2007, 13:18
  5. The difference beteen QDomNode and QDomElement
    By elcuco in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2006, 04:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.