Results 1 to 4 of 4

Thread: Using the same QXmlStreamReader across multiple classes to read a single XML file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using the same QXmlStreamReader across multiple classes to read a single XML file

    Quote Originally Posted by axeljaeger View Post
    You want to create a "hierarchical parser", is that correct? You see XML as a tree and you want to have two subtrees parsed by a different parser?
    Correct. How I have it setup now is BaseXmlReader has a constructor that accepts a pointer to a QXmlStreamReader. It then uses that as the reader instead of creating a new instance like it would with other constructors. It keeps track if it was given another QXmlStreamReader or it created it's own on construction, so at destruction it doesn't delete the QXmlStreamReader it was given from a parent reader.

  2. #2
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Using the same QXmlStreamReader across multiple classes to read a single XML file

    What if you make a singleton class containing the QXmlStreamReader or maybe use the visitor pattern?
    Misha R.evolution - High level Debugging IDE

    Programming is about 2 basic principles: KISS and RTFM!!!

Similar Threads

  1. Multiple timers in single Application
    By Qt Coder in forum Qt Programming
    Replies: 47
    Last Post: 5th October 2012, 13:23
  2. Multiple appearances in a single ui file
    By zgulser in forum Qt Tools
    Replies: 1
    Last Post: 5th June 2009, 19:12
  3. Single QGLContext across multiple QGLWidgets
    By pseudosig in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2008, 23:13
  4. How to create filmstrip - multiple images in a single file
    By jessiemmichael in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2008, 08:30
  5. insertion of multiple items in a single row
    By grimbaum in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2006, 05:36

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.