Commits

Aleš Erjavec committed 70b5918

Added gene count column to Import Gene Sets dialog.

Comments (0)

Files changed (1)

orangecontrib/bio/widgets/OWSelectGenes.py

         self.gsview.setAlternatingRowColors(True)
         self.gsview.setRootIsDecorated(False)
         self.gsview.setSelectionMode(QTreeView.ExtendedSelection)
+        self.gsview.setSortingEnabled(True)
+        self.gsview.setUniformRowHeights(True)
         self.proxymodel = QSortFilterProxyModel(
             filterKeyColumn=1, sortCaseSensitivity=Qt.CaseInsensitive
         )
 
 def sets_to_model(gsets):
     model = QStandardItemModel()
-    model.setHorizontalHeaderLabels(["Category", "Name"])
+    model.setHorizontalHeaderLabels(["Category", "Name", "#"])
 
     for (hier, tid), sets in gsets:
         for gset in sets:
             name.setData(gset, Qt.UserRole)
             name.setEditable(False)
             name.setToolTip(tooltip)
-            model.appendRow([category, name])
+            count = QStandardItem()
+            count.setData(ngenes, Qt.DisplayRole)
+            count.setToolTip(tooltip)
+            model.appendRow([category, name, count])
 
     return model