Commit 5a3005c0 by Michael Büsch

gui/tree: qt5 fix

Signed-off-by: Michael Buesch <m@bues.ch>
parent ea03c692
......@@ -333,12 +333,13 @@ class Tree(QTreeView):
def currentChanged(self, selected, deselected):
QTreeView.currentChanged(self, selected, deselected)
selected = self.model().mapToSource(selected)
treeItem = self.realModel().modelIndexToTreeItem(selected)
if treeItem.entityType == TreeItem.STOCKITEM:
self.itemChanged.emit(treeItem.entityId)
else:
self.itemChanged.emit(None)
if selected.isValid():
selected = self.model().mapToSource(selected)
treeItem = self.realModel().modelIndexToTreeItem(selected)
if treeItem.entityType == TreeItem.STOCKITEM:
self.itemChanged.emit(treeItem.entityId)
else:
self.itemChanged.emit(None)
def contextMenuEvent(self, event):
index = self.indexAt(event.pos())
......
Markdown is supported
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