Results 1 to 19 of 19

Thread: xstrm.read();

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    53

    Default Re: xstrm.read();

    Hi, without repeat all code before with your solution I've got the prevoius problem inside the file:
    Qt Code:
    1. <Light0 pos="4 1 4 1" //wrong
    To copy to clipboard, switch view to plain text mode 
    But if I use my prevoius code works (but i can put what Write() do only before tag PLAIN and not inside it....
    Qt Code:
    1. ..............................
    2. Write(QTextStream(&f));
    3. QDomText t1 = doc.createTextNode("hello");
    4. .............
    To copy to clipboard, switch view to plain text mode 
    Regards

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

    Default Re: xstrm.read();

    Quote Originally Posted by mickey
    <Light0 pos="4 1 4 1" //wrong
    Because you add this as text. That's how a text which contains <, > and " looks like in XML.

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    53

    Default Re: xstrm.read();

    sorry, but is it possible avoid this??
    Regards

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

    Default Re: xstrm.read();

    Quote Originally Posted by mickey
    sorry, but is it possible avoid this??
    It depends on what you are trying to achieve. Does Class.Write() output XML or plain text?

    What do you need QDomDocument for? Just to place the Class.Write() output between tags?

  5. #5
    Join Date
    Jan 2006
    Posts
    976
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    53

    Default Re: xstrm.read();

    Quote Originally Posted by jacek
    It depends on what you are trying to achieve. Does Class.Write() output XML or plain text?
    What do you need QDomDocument for? Just to place the Class.Write() output between tags?
    I'm a bit confused as you know. I need put output class between tag...
    class write do this....insert text in xstrm...
    Qt Code:
    1. void class::Write(QTextStream& xstrm) {
    2. xstrm << "dimX=\"" << dimX << "\"dim......
    To copy to clipboard, switch view to plain text mode 
    I dont' undesrtand
    Regards

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

    Default Re: xstrm.read();

    Quote Originally Posted by mickey
    I need put output class between tag...
    Then maybe this will be enough?
    Qt Code:
    1. QTextStream xstrm( &f );
    2. ...
    3. xstrm << "<tag1>";
    4. scene.p.XMLWrite( xstrm );
    5. xstrm << "</tag1>";
    6.  
    7. xstrm << "<tag2>";
    8. Class.Write( xstrm );
    9. xstrm << "</tag2>";
    10. ...
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Jan 2006
    Posts
    976
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    53

    Default Re: xstrm.read();

    I know this...I'm trying a way like this:
    Qt Code:
    1. QDomElement tag1( doc.createElement( "PLAIN Property" ) );
    2. QDomText t1( doc.createTextNode( text ) );
    3. tag1.appendChild( t1 );
    To copy to clipboard, switch view to plain text mode 
    using QDomElement to insert tag....
    Regards

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.