diff options
Diffstat (limited to 'utils/themeeditor/models/parsetreemodel.cpp')
-rw-r--r-- | utils/themeeditor/models/parsetreemodel.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/utils/themeeditor/models/parsetreemodel.cpp b/utils/themeeditor/models/parsetreemodel.cpp index a7f04ffbf2..01d60c8775 100644 --- a/utils/themeeditor/models/parsetreemodel.cpp +++ b/utils/themeeditor/models/parsetreemodel.cpp | |||
@@ -40,7 +40,7 @@ ParseTreeModel::ParseTreeModel(const char* document, QObject* parent): | |||
40 | this->tree = skin_parse(document); | 40 | this->tree = skin_parse(document); |
41 | 41 | ||
42 | if(tree) | 42 | if(tree) |
43 | this->root = new ParseTreeNode(tree); | 43 | this->root = new ParseTreeNode(tree, this); |
44 | else | 44 | else |
45 | this->root = 0; | 45 | this->root = 0; |
46 | 46 | ||
@@ -77,7 +77,7 @@ QString ParseTreeModel::changeTree(const char *document) | |||
77 | return error; | 77 | return error; |
78 | } | 78 | } |
79 | 79 | ||
80 | ParseTreeNode* temp = new ParseTreeNode(test); | 80 | ParseTreeNode* temp = new ParseTreeNode(test, this); |
81 | 81 | ||
82 | if(root) | 82 | if(root) |
83 | { | 83 | { |
@@ -364,3 +364,17 @@ QGraphicsScene* ParseTreeModel::render(ProjectModel* project, | |||
364 | 364 | ||
365 | return scene; | 365 | return scene; |
366 | } | 366 | } |
367 | |||
368 | void ParseTreeModel::paramChanged(ParseTreeNode *param) | ||
369 | { | ||
370 | QModelIndex index = indexFromPointer(param); | ||
371 | emit dataChanged(index, index); | ||
372 | } | ||
373 | |||
374 | QModelIndex ParseTreeModel::indexFromPointer(ParseTreeNode *p) | ||
375 | { | ||
376 | /* Recursively finding an index for an arbitrary pointer within the tree */ | ||
377 | if(!p->getParent()) | ||
378 | return QModelIndex(); | ||
379 | return index(p->getRow(), 0, indexFromPointer(p->getParent())); | ||
380 | } | ||