mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
network: Table combo box set on current value.
This commit is contained in:
1 parent
a18cb2d65f
commit
53994ea923
1 file changed
+2
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user