summaryrefslogtreecommitdiff
path: root/utils/themeeditor/models
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/models')
-rw-r--r--utils/themeeditor/models/parsetreemodel.cpp14
-rw-r--r--utils/themeeditor/models/parsetreemodel.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/utils/themeeditor/models/parsetreemodel.cpp b/utils/themeeditor/models/parsetreemodel.cpp
index e30d0be..ed5f574 100644
--- a/utils/themeeditor/models/parsetreemodel.cpp
+++ b/utils/themeeditor/models/parsetreemodel.cpp
@@ -342,8 +342,9 @@ QGraphicsScene* ParseTreeModel::render(ProjectModel* project,
sbsInfo = RBRenderInfo(sbsModel, project, doc, &settings,
device, sbsScreen);
sbsModel->root->render(sbsInfo);
- }
+ setChildrenUnselectable(sbsScreen);
+ }
}
}
@@ -384,3 +385,14 @@ QModelIndex ParseTreeModel::indexFromPointer(ParseTreeNode *p)
return QModelIndex();
return index(p->getRow(), 0, indexFromPointer(p->getParent()));
}
+
+void ParseTreeModel::setChildrenUnselectable(QGraphicsItem *root)
+{
+ root->setFlag(QGraphicsItem::ItemIsSelectable, false);
+ root->setFlag(QGraphicsItem::ItemIsMovable, false);
+
+ QList<QGraphicsItem*> children = root->children();
+ for(QList<QGraphicsItem*>::iterator i = children.begin()
+ ; i != children.end(); i++)
+ setChildrenUnselectable(*i);
+}
diff --git a/utils/themeeditor/models/parsetreemodel.h b/utils/themeeditor/models/parsetreemodel.h
index 2c762f3..f176b76 100644
--- a/utils/themeeditor/models/parsetreemodel.h
+++ b/utils/themeeditor/models/parsetreemodel.h
@@ -80,6 +80,8 @@ public:
QModelIndex indexFromPointer(ParseTreeNode* p);
private:
+ void setChildrenUnselectable(QGraphicsItem* root);
+
ParseTreeNode* root;
ParseTreeModel* sbsModel;
struct skin_element* tree;