QElectroTech  0.70
Functions
QETXML Namespace Reference

Functions

QDomElement penToXml (QDomDocument &parent_document, const QPen &pen)
 QETXML::penToXml Write attribute of a QPen in xml element. More...
 
QPen penFromXml (const QDomElement &element)
 QETXML::penFromXml Build a QPen from a xml description. More...
 
QDomElement brushToXml (QDomDocument &parent_document, const QBrush &brush)
 QETXML::brushToXml Write attribute of a QBrush in xml element. More...
 
QBrush brushFromXml (const QDomElement &element)
 QETXML::brushFromXml Build a QBrush from a xml description. More...
 
QDomElement fileSystemDirToXmlCollectionDir (QDomDocument &document, const QDir &dir, const QString &rename=QString())
 
QDomElement fileSystemElementToXmlCollectionElement (QDomDocument &document, QFile &file, const QString &rename=QString())
 
bool writeXmlFile (const QDomDocument &xml_document, const QString &file_path, QString *error_message=nullptr)
 QETXML::writeXmlFile Export an XML document to an UTF-8 text file indented with 4 spaces, with LF end of lines and no BOM. More...
 
QDomElement textToDomElement (QDomDocument &document, const QString &tag_name, const QString &value)
 QETXML::textToDomElement Return a QDomElement, created from , with tag name and text . More...
 

Detailed Description

This namespace contain some function to use xml with QET.

Function Documentation

◆ brushFromXml()

QBrush QETXML::brushFromXml ( const QDomElement &  element)

QETXML::brushFromXml Build a QBrush from a xml description.

Parameters
element,theQDomElement that describe the pen
Returns
the created brush. If is null or tagName isn't "brush" return a default constructed QBrush

Definition at line 128 of file qetxml.cpp.

Referenced by QetShapeItem::fromXml().

◆ brushToXml()

QDomElement QETXML::brushToXml ( QDomDocument &  parent_document,
const QBrush &  brush 
)

QETXML::brushToXml Write attribute of a QBrush in xml element.

Parameters
parent_document: parent document for create the QDomElement
brush: the brush to store
Returns
A QDomElement with the attribute stored. The tagName of QDomeElement is "brush".

Definition at line 91 of file qetxml.cpp.

Referenced by QetShapeItem::toXml().

◆ fileSystemDirToXmlCollectionDir()

QDomElement QETXML::fileSystemDirToXmlCollectionDir ( QDomDocument &  document,
const QDir &  dir,
const QString &  rename = QString() 
)

Definition at line 165 of file qetxml.cpp.

References QET::Icons::nl.

Referenced by XmlElementCollection::addElement(), and XmlElementCollection::copyDirectory().

◆ fileSystemElementToXmlCollectionElement()

QDomElement QETXML::fileSystemElementToXmlCollectionElement ( QDomDocument &  document,
QFile &  file,
const QString &  rename = QString() 
)

◆ penFromXml()

QPen QETXML::penFromXml ( const QDomElement &  element)

QETXML::penFromXml Build a QPen from a xml description.

Parameters
element,TheQDomElement that describe the pen
Returns
the created pen. If is null or tagName isn't "pen" return a default constructed QPen

Definition at line 59 of file qetxml.cpp.

Referenced by QetShapeItem::fromXml().

◆ penToXml()

QDomElement QETXML::penToXml ( QDomDocument &  parent_document,
const QPen &  pen 
)

QETXML::penToXml Write attribute of a QPen in xml element.

Parameters
parent_document: parent document for create the QDomElement
pen: the pen to store
Returns
: A QDomElement with the attribute stored. The tagName of QDomeElement is "pen".

Definition at line 30 of file qetxml.cpp.

Referenced by QetShapeItem::toXml().

◆ textToDomElement()

QDomElement QETXML::textToDomElement ( QDomDocument &  document,
const QString &  tag_name,
const QString &  value 
)

QETXML::textToDomElement Return a QDomElement, created from , with tag name and text .

Parameters
document
tag_name
value
Returns

Definition at line 269 of file qetxml.cpp.

Referenced by autonum::sequentialNumbers::toXml().

◆ writeXmlFile()

bool QETXML::writeXmlFile ( const QDomDocument &  xml_document,
const QString &  file_path,
QString *  error_message = nullptr 
)

QETXML::writeXmlFile Export an XML document to an UTF-8 text file indented with 4 spaces, with LF end of lines and no BOM.

Parameters
xml_document: An XML document to be exported
file_path: Path to the file to be written
error_message: If non-zero, will contain an error message explaining what happened when this function returns false.
Returns
false if an error occurred, true otherwise

Definition at line 235 of file qetxml.cpp.

References QET::Icons::tr.

Referenced by ElementsLocation::setXml().