equal
deleted
inserted
replaced
45 #include <QAbstractItemModel> |
45 #include <QAbstractItemModel> |
46 #include <QDomDocument> |
46 #include <QDomDocument> |
47 #include <QModelIndex> |
47 #include <QModelIndex> |
48 #include <QVariant> |
48 #include <QVariant> |
49 |
49 |
|
50 /* |
|
51 * This class encapsulates the DOM tree for the build output log and provides |
|
52 * an interface to the classes which presents it to the user. |
|
53 */ |
|
54 |
50 class DomItem; |
55 class DomItem; |
51 |
56 |
52 class DomModel : public QAbstractItemModel |
57 class DomModel : public QAbstractItemModel |
53 { |
58 { |
54 Q_OBJECT |
59 Q_OBJECT |
55 |
60 |
56 public: |
61 public: |
57 DomModel(QDomDocument document, QObject *parent = 0); |
62 DomModel(QDomDocument *document, QObject *parent = 0); |
58 ~DomModel(); |
63 ~DomModel(); |
59 |
64 |
60 QVariant data(const QModelIndex &index, int role) const; |
65 QVariant data(const QModelIndex &index, int role) const; |
61 Qt::ItemFlags flags(const QModelIndex &index) const; |
66 Qt::ItemFlags flags(const QModelIndex &index) const; |
62 QVariant headerData(int section, Qt::Orientation orientation, |
67 QVariant headerData(int section, Qt::Orientation orientation, |
66 QModelIndex parent(const QModelIndex &child) const; |
71 QModelIndex parent(const QModelIndex &child) const; |
67 int rowCount(const QModelIndex &parent = QModelIndex()) const; |
72 int rowCount(const QModelIndex &parent = QModelIndex()) const; |
68 int columnCount(const QModelIndex &parent = QModelIndex()) const; |
73 int columnCount(const QModelIndex &parent = QModelIndex()) const; |
69 |
74 |
70 private: |
75 private: |
71 QDomDocument domDocument; |
76 QDomDocument *domDocument; |
72 DomItem *rootItem; |
77 DomItem *rootItem; |
73 }; |
78 }; |
74 |
79 |
75 #endif |
80 #endif |