mirror of https://gitlab.com/pamhyr/pamhyr2
network: Table combo box set on current value.
parent
a18cb2d65f
commit
53994ea923
|
|
@ -25,6 +25,7 @@ class ComboBoxDelegate(QItemDelegate):
|
||||||
def createEditor(self, parent, option, index):
|
def createEditor(self, parent, option, index):
|
||||||
self.editor = QComboBox(parent)
|
self.editor = QComboBox(parent)
|
||||||
self.editor.addItems(self.graph.nodes_names())
|
self.editor.addItems(self.graph.nodes_names())
|
||||||
|
self.editor.setCurrentText(index.data(Qt.DisplayRole))
|
||||||
return self.editor
|
return self.editor
|
||||||
|
|
||||||
def setEditorData(self, editor, index):
|
def setEditorData(self, editor, index):
|
||||||
|
|
@ -54,6 +55,7 @@ class TrueFalseComboBoxDelegate(QItemDelegate):
|
||||||
def createEditor(self, parent, option, index):
|
def createEditor(self, parent, option, index):
|
||||||
self.editor = QComboBox(parent)
|
self.editor = QComboBox(parent)
|
||||||
self.editor.addItems(["true", "false"])
|
self.editor.addItems(["true", "false"])
|
||||||
|
self.editor.setCurrentText("true" if index.data(Qt.DisplayRole) else "false")
|
||||||
return self.editor
|
return self.editor
|
||||||
|
|
||||||
def setEditorData(self, editor, index):
|
def setEditorData(self, editor, index):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue