Results 1 to 4 of 4

Thread: QXmlStreamAttribute name and value?

  1. #1
    Join Date
    Aug 2008
    Posts
    10
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QXmlStreamAttribute name and value?

    I'm using the QXmlStreamReader to parse an xml doc and after I get to a tag and check for any attributes, I'd like to pull the name and value of the attribute into a QString. But I'm not sure how to do this after looking over the docs. I got this so far

    QXmlStreamAttribute att = reader->attributes().at(0);

    but I don't see any way to access the strings in the att, if that's really what's in there. Could anyone tell me what functions I use from this point to access the name and value of the att that got pulled from a tag?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QXmlStreamAttribute name and value?

    Qt Code:
    1. QXmlStreamAttribute att = reader->attributes().at(0);
    2. QString name = att.name().toString();
    3. QString value = att.value().toString();
    To copy to clipboard, switch view to plain text mode 
    ???

  3. #3
    Join Date
    Aug 2008
    Posts
    10
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QXmlStreamAttribute name and value?

    Guess these were the wrong docs http://doc.trolltech.com/4.4/qxmlstreamattributes.html

    Thanks alot.

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QXmlStreamAttribute name and value?

    Quote Originally Posted by warry View Post
    Guess these were the wrong docs http://doc.trolltech.com/4.4/qxmlstreamattributes.html

    Thanks alot.
    that's it what you need
    QXmlStreamAttribute

  5. The following user says thank you to spirit for this useful post:

    warry (14th August 2008)

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.