I'm trying to validate an xml file against a specific schema.
So I'm loading the schema into the QXmlSchema object. But I get some strange errors.
My code looks like:
int main() {
QUrl url("http://www.schema-example.org/myschema.xsd");
QXmlSchema schema;
if (schema.load(url) == true)
qDebug() << "schema is valid";
else
qDebug() << "schema is invalid";
return 1;
}
When I try to run the above piece of code, Qt errors out saying:
QEventLoop: Cannot be used without QApplication
QDBusConnection: system D_Bus connection created before QCoreApplication.
Application may misbehave.
QEventLoop: Cannot be used without QApplication
My Qt Designer version: qt4-designer 4:4.8.1-0ubuntu4.1
My Qt Creator version : qtcreator 2.4.1-0ubuntu2
Could someone please help me to solve this problem.
Thanks