PropertyNullParser.cpp
Go to the documentation of this file.00001 #include "PropertyNullParser.h"
00002 #include "PropertyParser.h"
00003 #include "exception/XmlParseException.h"
00004
00005 #include <QtXml/QDomDocument>
00006 #include <QtXml/QDomNode>
00007 #include <QString>
00008 #include <QHash>
00009 #include <QtPlugin>
00010
00011 using namespace qic;
00012
00013 QVariant
00014 PropertyNullParser::parseProperty (const QDomNode & prop, QHash <QString, QObject *> & )
00015 {
00016 QDomElement e = prop.toElement();
00017 if(e.tagName() == "null")
00018 {
00019 return QVariant(QString());
00020 }
00021 else
00022 {
00023 throw XmlParseException (QString("Expecting null, %1 encountered.").arg(e.tagName()));
00024 }
00025 }
00026
00027 Q_EXPORT_PLUGIN2(null_parser, PropertyNullParser)
00028
00029