Qt Utilities  5.6.0
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Macros
xmlparsermacros.h File Reference

Macros to utilize XML parsing using QXmlStreamReader. More...

#include "./undefxmlparsermacros.h"
Include dependency graph for xmlparsermacros.h:

Go to the source code of this file.

Macros

#define iftag(tagName)   if(xmlReader.name() == QLatin1String(tagName))
 
#define eliftag(tagName)   else if(xmlReader.name() == QLatin1String(tagName))
 
#define else_skip   else { xmlReader.skipCurrentElement(); }
 
#define children   while(xmlReader.readNextStartElement())
 
#define text   (xmlReader.readElementText(QXmlStreamReader::ErrorOnUnexpectedElement))
 
#define attribute(attributeName)   (xmlReader.attributes().value(QLatin1String(attributeName)))
 
#define attributeFlag(attributeName)   (xmlReader.attributes().hasAttribute(QLatin1String(attributeName)) && xmlReader.attributes().value(QLatin1String(attributeName)) != QLatin1String("false"))
 

Detailed Description

Macros to utilize XML parsing using QXmlStreamReader.

See also
For an example, see dbquery.cpp of the tageditor project.

Definition in file xmlparsermacros.h.

Macro Definition Documentation

◆ attribute

#define attribute (   attributeName)    (xmlReader.attributes().value(QLatin1String(attributeName)))

Definition at line 15 of file xmlparsermacros.h.

◆ attributeFlag

#define attributeFlag (   attributeName)    (xmlReader.attributes().hasAttribute(QLatin1String(attributeName)) && xmlReader.attributes().value(QLatin1String(attributeName)) != QLatin1String("false"))

Definition at line 16 of file xmlparsermacros.h.

◆ children

#define children   while(xmlReader.readNextStartElement())

Definition at line 13 of file xmlparsermacros.h.

◆ eliftag

#define eliftag (   tagName)    else if(xmlReader.name() == QLatin1String(tagName))

Definition at line 11 of file xmlparsermacros.h.

◆ else_skip

#define else_skip   else { xmlReader.skipCurrentElement(); }

Definition at line 12 of file xmlparsermacros.h.

◆ iftag

#define iftag (   tagName)    if(xmlReader.name() == QLatin1String(tagName))

Definition at line 10 of file xmlparsermacros.h.

◆ text

#define text   (xmlReader.readElementText(QXmlStreamReader::ErrorOnUnexpectedElement))

Definition at line 14 of file xmlparsermacros.h.