Results 1 to 7 of 7

Thread: Problem with Deleting QDomNode

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Posts
    39
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with Deleting QDomNode

    Here my source code:
    Qt Code:
    1. QDomElement rootOfTag=fieldState.firstChild().firstChildElement(parent);
    2. QDomNodeList sameTags=rootOfTag.elementsByTagName(node.firstChild().toElement().tagName());
    3. for(uint i=0;i<sameTags.length();i++)
    4. {
    5. QDomNode nodeToReplace=sameTags.item(i);
    6. if(nodeToReplace.toElement().attribute("id")==node.firstChild().toElement().attribute("id"))
    7. {
    8. rootOfTag.removeChild(nodeToReplace);
    9. return true;
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

    Although it enters into if part, it can't remove "nodeToReplace" . What can be my problem?

    Edit: nodeToReplace.nodeType() returns QDomNode::ElementNode, can problem related with that?
    Last edited by metdos; 15th July 2010 at 09:42.

Similar Threads

  1. deleting QStringList
    By timmu in forum Qt Programming
    Replies: 5
    Last Post: 18th December 2009, 13:36
  2. QMdiSubWindows - Deleting
    By Kerubu in forum Newbie
    Replies: 1
    Last Post: 25th August 2009, 05:23
  3. QDomNode
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 14th September 2007, 06:11
  4. QDomNode
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 6th September 2007, 12:18
  5. The difference beteen QDomNode and QDomElement
    By elcuco in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2006, 03: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
  •  
Qt is a trademark of The Qt Company.