From d505bc01195ddc4ca6e57efe42b97f1ce49d6afd Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Fri, 6 Aug 2010 05:34:01 +0000 Subject: Theme Editor: Made SBS elements in WPS documents non-interactive, which makes it a little more difficult to crash the editor git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27734 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/models/parsetreemodel.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'utils/themeeditor/models/parsetreemodel.cpp') 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 children = root->children(); + for(QList::iterator i = children.begin() + ; i != children.end(); i++) + setChildrenUnselectable(*i); +} -- cgit v1.2.3