Results 1 to 4 of 4

Thread: Extracting text from QDomNodes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Extracting text from QDomNodes

    The docs say:
    QString QDomNode::nodeValue () const
    Returns the value of the node.
    The meaning of the value depends on the subclass:
    (...)
    All the other subclasses do not have a node value and will return an empty string.
    Unfortunately QDomElement falls into "other subclasses" category.

    Try:
    Qt Code:
    1. titles.item( t ).toElement().text();
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to jacek for this useful post:

    Matt Smith (25th February 2007)

  3. #2
    Join Date
    Jan 2006
    Location
    New Malden (near London)
    Posts
    32
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Extracting text from QDomNodes

    Thanks an awful lot, I am not all that familiar with DOM and did not think of that. It works now.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30
  4. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09:02
  5. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03

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.