PDA

View Full Version : Error codes in QtXml



suneel1310
7th September 2010, 08:39
Hi all,

I have an object of QXmlSimpleReader 'xmlReader'. And an 'inputSource' of type QXmlInputSource.

So for parsing i used parse()

int parseError = xmlReader.parse(inputSource);

this parse() returns only true or false but it doesn't return any error code for failure cases.

I did

QXmlErrorHandler* errHandler = xmlReader.errorHandler();
QString errString = errHandler->errorString();

after calling parse() but it gives error description but not error code.

So how to get the error codes when parse() fails ? So that I can map the error codes with the native error codes and communicate it to the clients.