Results 1 to 7 of 7

Thread: How to read and get the values out of the xml?

  1. #1
    Join Date
    Jul 2008
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy How to read and get the values out of the xml?

    How to read and get the values out of the xml file and set text to the textfields?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to read and get the values out of the xml?

    Please search previous threads. This has been discussed recently.
    One link is this

  3. #3
    Join Date
    Jul 2008
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to read and get the values out of the xml?

    but they are creating and write on the xml file.. i need to noe how to read and get values out from the xml file and put into the textfield.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to read and get the values out of the xml?

    Use QDomDocument as suggested.

  5. #5
    Join Date
    Jul 2008
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11

    Talking Re: How to read and get the values out of the xml?

    How to use QDomDocument??
    Can i have the sample?? to retrieve values from xml file...
    thanks

  6. #6
    Join Date
    May 2008
    Posts
    58
    Thanks
    2

    Default Re: How to read and get the values out of the xml?

    Qt Code:
    1. QDomElement domElement
    2. if ( !domElement.isNull() )
    3. {
    4. QString elementName = domElement.tagName();
    5. if ( elementName.compare( "position" ) == 0 )
    6. {
    7. // Convert to position
    8. QPoint p0;
    9. p0.setX( domElement.attribute( "x" ).toInt() );
    10. p0.setY( domElement.attribute( "y" ).toInt() );
    11.  
    12. }
    13. }
    To copy to clipboard, switch view to plain text mode 
    it is a simple example for read <position x="12",y="13"/> , good luck!
    Last edited by jpn; 21st July 2008 at 19:58. Reason: missing [code] tags

  7. #7
    Join Date
    Jul 2008
    Posts
    16
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to read and get the values out of the xml?

    thanks.. i will try..

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.