Results 1 to 5 of 5

Thread: problem in xml parsing

  1. #1
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default problem in xml parsing

    code like this:

    Qt Code:
    1. Paser::Paser(QObject *parent)
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. QXmlInputSource inputSource(&file);
    2. Paser *handler;
    3. reader.setContentHandler(handler);
    4. reader.setErrorHandler(handler);
    5. bool xx;
    6. xx = reader.parse(inputSource);
    To copy to clipboard, switch view to plain text mode 

    I trace the steps when debugging, seems that the program never enter the "paser.cpp" file, what does that mean?

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

    Default Re: problem in xml parsing

    Where do you initialize "handler"?

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

    Shawn (28th May 2007)

  4. #3
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problem in xml parsing

    what should I do to initialize it ?

  5. #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: problem in xml parsing

    Create an object and assign it to the pointer. Thus far you only have a piece of memory that can point to a "Paser" object, but not the object itself.

  6. The following user says thank you to wysota for this useful post:

    Shawn (28th May 2007)

  7. #5
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problem in xml parsing

    thank you very much, wysota!
    now it works!

    thank you.

Similar Threads

  1. XML Parsing in Qt 3.3
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 18th April 2007, 18:54
  2. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  3. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.