Results 1 to 3 of 3

Thread: QDomElement::setAttribute() doesn't work : (

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QDomElement::setAttribute() doesn't work : (

    Hi
    I want to add some Elements to a QDomNode (node).

    the output should be:
    <node>
    <sy href = "test1">
    <sy href = "test2">
    <sy href = "test3">
    </node>

    at the beginning i have <sy href = "test1"> and I know that there come three same elements with the same attributes, but different values. I create three sy elements and add the attributes with:
    Qt Code:
    1. element.setAttribute("href","test1");
    To copy to clipboard, switch view to plain text mode 
    and then add the elemnt to the node
    Qt Code:
    1. node.appandChild(element)
    To copy to clipboard, switch view to plain text mode 

    the output is:

    <node>
    <sy href = "test1">
    <sy href = "">
    <sy href = "">
    </node>

    why?
    thank u for yout help

  2. #2
    Join Date
    Aug 2011
    Location
    Seoul, Korea
    Posts
    46
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDomElement::setAttribute() doesn't work : (

    Can you show us the way you set the elements for test2 and test3? Since you are showing only the codes working properly... it's bit hard to help? =)

    Regards,
    Dong Back Kim

  3. The following user says thank you to Dong Back Kim for this useful post:

    Qiieha (11th August 2011)

  4. #3
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDomElement::setAttribute() doesn't work : (

    thank u for the effort!

    i solved the problem. it was my fault, that it didn't work. sorry for this thread!

Similar Threads

  1. QxtBlowfish doesn't work
    By fab_74 in forum Qt Programming
    Replies: 3
    Last Post: 8th June 2011, 22:07
  2. Screenshot example doesn't work on Mac OSX
    By Damiano in forum Qt Programming
    Replies: 0
    Last Post: 19th January 2011, 11:17
  3. Replies: 1
    Last Post: 16th September 2010, 15:57
  4. setTabStopWidth doesn't work
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 19th November 2007, 08:29
  5. setMouseTracking() doesn't work.
    By luffy27 in forum Qt Programming
    Replies: 13
    Last Post: 27th April 2007, 18:16

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.