Commit 53994ea9 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

network: Table combo box set on current value.

Showing with 2 additions and 0 deletions
+2 -0
......@@ -25,6 +25,7 @@ class ComboBoxDelegate(QItemDelegate):
def createEditor(self, parent, option, index):
self.editor = QComboBox(parent)
self.editor.addItems(self.graph.nodes_names())
self.editor.setCurrentText(index.data(Qt.DisplayRole))
return self.editor
def setEditorData(self, editor, index):
......@@ -54,6 +55,7 @@ class TrueFalseComboBoxDelegate(QItemDelegate):
def createEditor(self, parent, option, index):
self.editor = QComboBox(parent)
self.editor.addItems(["true", "false"])
self.editor.setCurrentText("true" if index.data(Qt.DisplayRole) else "false")
return self.editor
def setEditorData(self, editor, index):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment