xmlElementCollection : collection can add new item.

elementsCollectionModel : Up to date the content when a new item is added to the embedded collection of a project.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4312 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-01-08 17:01:51 +00:00
parent fc8b4b974d
commit 7fdcb0060c
12 changed files with 438 additions and 25 deletions

View File

@@ -22,6 +22,7 @@
#include <QDomElement>
class QDomElement;
class QFile;
/**
* @brief The XmlElementCollection class
@@ -34,19 +35,28 @@ class XmlElementCollection : public QObject
XmlElementCollection (QObject *parent = nullptr);
XmlElementCollection (const QDomElement &dom_element, QObject *parent = nullptr);
QDomElement root() const;
QDomNodeList childs(const QDomElement &parent_element);
QList<QDomElement> directory(const QDomElement &parent_element);
QDomElement importCategory() const;
QDomNodeList childs(const QDomElement &parent_element) const;
QDomElement child(const QDomElement &parent_element, const QString &child_name) const;
QList<QDomElement> directories(const QDomElement &parent_element);
QList<QDomElement> elements(const QDomElement &parent_element);
QDomElement element(const QString &path);
QDomElement directory(const QString &path);
QString addElement (const QString &path);
bool exist (const QString &path);
signals:
/**
* @brief elementAdded
* This signal is emited when a element is added to this collection
* @param collection_path, the path of element in this collection
*/
void elementAdded(QString collection_path);
public slots:
private:
QDomDocument m_dom_document;
};
#endif // XMLELEMENTCOLLECTION_H