Results 1 to 3 of 3

Thread: XmlStreamreader drives me crazy!!!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2013
    Location
    luxemburg
    Posts
    10
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default XmlStreamreader drives me crazy!!!

    hi,
    im trying to read the following:
    <strengthClass name = "C14">
    <roh_k>290</roh_k>
    <fm_k>14</fm_k>
    <ft0_k>8</ft0_k>
    ...
    ...more of theese
    </strengthClass>

    i tried with:
    Qt Code:
    1. if (name() == "strengthClass")
    2. {
    3. strengthClass = attributes().value("name").toString();
    4. readNextStartElement();
    5. while(!(this->tokenType() == EndElement && name() == "strengthClass"))
    6. {
    7. if(name() =="roh_k")
    8. {
    9. roh_k = text().toString().toDouble(); // not working
    10. }
    11. else if(name() == "fm_k")
    12. {
    13. fm_k =text().toAscii().toDouble(); // this neither
    14. //...
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: XmlStreamreader drives me crazy!!!

    readElementText() instead of text()

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    pipapongo (18th April 2013)

  4. #3
    Join Date
    Apr 2013
    Location
    luxemburg
    Posts
    10
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: XmlStreamreader drives me crazy!!!

    thank you so much

    it could be so easy....

Similar Threads

  1. I'm going crazy, pointer problem .??
    By tonnot in forum General Programming
    Replies: 4
    Last Post: 29th June 2011, 11:46
  2. Qt Designer QtDesigner Gone Crazy!
    By qtoptus in forum Qt Tools
    Replies: 6
    Last Post: 26th January 2011, 02:17
  3. a crazy problem~~~who can help me : (
    By sunking_426 in forum Qt Programming
    Replies: 4
    Last Post: 2nd January 2009, 14:35
  4. Crazy over the QGraphicsScene/Item
    By Morea in forum Qt Programming
    Replies: 6
    Last Post: 20th November 2006, 09:18

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.