summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor')
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp2
-rw-r--r--utils/themeeditor/models/parsetreemodel.cpp14
-rw-r--r--utils/themeeditor/models/parsetreemodel.h2
3 files changed, 15 insertions, 3 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index 015ed729d1..3b97e7143d 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -48,8 +48,6 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info,
leftGraphic(0), centerGraphic(0), rightGraphic(0), scrollTime(0),
node(pNode), doc(info.document())
{
- setFlags(ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges);
-
if(!node->tag)
{
/* Default viewport takes up the entire screen */
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);
+}
diff --git a/utils/themeeditor/models/parsetreemodel.h b/utils/themeeditor/models/parsetreemodel.h
index 2c762f3645..f176b760d3 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;