diff --git a/XML_xmlparser.cpp b/XML_xmlparser.cpp deleted file mode 100644 index 717b1b207844f78c2f0703c4b776cbb6d467650d..0000000000000000000000000000000000000000 --- a/XML_xmlparser.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "xmlparser.h" -#include "ui_mainwindow.h" - -bool XMLParser::startElement(const QString&, - const QString&, - const QString& tagName, - const QXmlAttributes& - ) -{ - if(tagName == "catalog") - treeItem = new QTreeWidgetItem(treeWidget); - - else - treeItem = new QTreeWidgetItem(treeItem); - return true; -} - -// ------------------------------------------------------------------ -bool XMLParser::characters(const QString& strText) -{ - m_strText = ": " + strText; - return true; -} - -// ------------------------------------------------------------------ -bool XMLParser::endElement(const QString&, const QString&, const QString& str) -{ - treeItem->setText(0, str + m_strText); - if(treeItem->parent() && treeItem->parent()->text(0) == "") - treeItem = treeItem->parent(); - m_strText = ""; - if(str == "catalog") - treeItem->setText(0, title); - -return true; -} - -// ------------------------------------------------------------------ -bool XMLParser::fatalError(const QXmlParseException& exception) -{ - QString str = "Line: " + QString::number(exception.lineNumber()) + ", Column: " + QString::number(exception.columnNumber()) + ", Message: " + exception.message(); - QMessageBox::warning(nullptr, "Ошибка", str); - - return false; -}