summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/models/parsetreemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/models/parsetreemodel.cpp')
-rw-r--r--utils/themeeditor/models/parsetreemodel.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/utils/themeeditor/models/parsetreemodel.cpp b/utils/themeeditor/models/parsetreemodel.cpp
index e30d0be09d..ed5f5740c3 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);
+}