-
Notifications
You must be signed in to change notification settings - Fork 0
/
xml_tree.h
52 lines (33 loc) · 1.07 KB
/
xml_tree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef XML_VIEWER_XML_TREE_H
#define XML_VIEWER_XML_TREE_H
#include <QDomElement>
#include <QTreeWidget>
#include <QLabel>
#include <memory>
#include "utils.h"
namespace xml_viewer
{
class XML_tree: public QTreeWidget{
Q_OBJECT
public:
XML_tree();
public slots:
bool load_file(const QString& file_name);
signals:
void reloaded() const;
private:
void build_widget_tree(const QDomElement& dom_root);
std::unique_ptr<File_watcher> file_watcher_{};
std::unique_ptr<Editor_mappings> mappings_filter_{};
};
const QString& element_name_template();
const QString& attribute_template();
void add_dom_node(const QDomNode& dom_node,
QTreeWidgetItem* widget_node);
void add_dom_attribute(const QDomAttr& dom_attribute,
QTreeWidgetItem* widget_node);
void add_dom_text_node(const QDomText& dom_text_node,
QTreeWidgetItem* widget_node);
std::unique_ptr<QLabel> make_wrapped_label(const QString& text);
}
#endif