PDA

View Full Version : QDomDocument problem !!!



probine
14th December 2006, 21:59
I have no idea why I am getting this problem.



QDomDocument doc();
if(!doc.setContent(messageIn))
cout << "The message received from the client is not well formed XML\n";


I have included QDomDocument, and I get this error:

message.cpp: In member function `void Message::parseMessage(QString)':
message.cpp:28: error: request for member `setContent' in `doc', which is of non-class type `QDomDoc
ument ()()'

Why, why why ?

jacek
14th December 2006, 22:30
Why, why why ?
Because

QDomDocument doc();is a forward declaration of a function that has no arguments and returns QDomDocument. Remove those "()" and everything will be OK.