mirror of
https://github.com/wassname/sloth.git
synced 2026-08-03 13:10:49 +08:00
Display annotations again with Python 2
This commit is contained in:
@@ -106,7 +106,10 @@ class AnnotationScene(QGraphicsScene):
|
||||
# create a graphics item for each model index
|
||||
for row in range(first, last+1):
|
||||
child = self.root_.child(row, 0) # get index
|
||||
_type = str(child.data(TypeRole)) # get type from index
|
||||
t = child.data(TypeRole) # get type from index
|
||||
if isinstance(t, QVariant):
|
||||
t = t.toPyObject()
|
||||
_type = str(t)
|
||||
item = self.itemfactory_.create(_type, self.model_.itemFromIndex(child)) # create graphics item from factory
|
||||
if item is not None:
|
||||
self.addItem(item)
|
||||
|
||||
Reference in New Issue
Block a user