enable tree decoration
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 10 Sep 2010 12:44:47 +0000 (14:44 +0200)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 10 Sep 2010 12:44:47 +0000 (14:44 +0200)
sface/screens/mainscreen.py

index 6a2b95b..4eb4a20 100644 (file)
@@ -14,7 +14,7 @@ class NodeView(QTreeView):
         QTreeView.__init__(self, parent)
 
         self.setItemsExpandable(True)
         QTreeView.__init__(self, parent)
 
         self.setItemsExpandable(True)
-        self.setRootIsDecorated(False)
+        self.setRootIsDecorated(True)
         self.setAlternatingRowColors(True)
         self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
 
         self.setAlternatingRowColors(True)
         self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
 
@@ -93,6 +93,11 @@ class NodeModel(QAbstractItemModel):
             return self.rootItem.data(section)
         return QVariant()
 
             return self.rootItem.data(section)
         return QVariant()
 
+    def flags(self, index):
+        if not index.isValid():
+            return 0
+        return Qt.ItemIsEnabled | Qt.ItemIsSelectable
+
     def index(self, row, column, parent):
         if not self.hasIndex(row, column, parent):
             return QModelIndex()
     def index(self, row, column, parent):
         if not self.hasIndex(row, column, parent):
             return QModelIndex()