summaryrefslogtreecommitdiff
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,
342 sbsInfo = RBRenderInfo(sbsModel, project, doc, &settings, 342 sbsInfo = RBRenderInfo(sbsModel, project, doc, &settings,
343 device, sbsScreen); 343 device, sbsScreen);
344 sbsModel->root->render(sbsInfo); 344 sbsModel->root->render(sbsInfo);
345 }
346 345
346 setChildrenUnselectable(sbsScreen);
347 }
347 } 348 }
348 } 349 }
349 350
@@ -384,3 +385,14 @@ QModelIndex ParseTreeModel::indexFromPointer(ParseTreeNode *p)
384 return QModelIndex(); 385 return QModelIndex();
385 return index(p->getRow(), 0, indexFromPointer(p->getParent())); 386 return index(p->getRow(), 0, indexFromPointer(p->getParent()));
386} 387}
388
389void ParseTreeModel::setChildrenUnselectable(QGraphicsItem *root)
390{
391 root->setFlag(QGraphicsItem::ItemIsSelectable, false);
392 root->setFlag(QGraphicsItem::ItemIsMovable, false);
393
394 QList<QGraphicsItem*> children = root->children();
395 for(QList<QGraphicsItem*>::iterator i = children.begin()
396 ; i != children.end(); i++)
397 setChildrenUnselectable(*i);
398}