mirror of
https://github.com/wassname/sloth.git
synced 2026-07-13 13:42:54 +08:00
add TypeRole, returning the type of an AnnotationModelItem
This commit is contained in:
+3
-1
@@ -4,7 +4,7 @@ from functools import partial
|
||||
import os.path
|
||||
import okapy
|
||||
|
||||
DataRole, ImageRole = [Qt.UserRole + i for i in range(1,3)]
|
||||
TypeRole, DataRole, ImageRole = [Qt.UserRole + i + 1 for i in range(3)]
|
||||
|
||||
class ModelItem:
|
||||
def __init__(self, parent=None):
|
||||
@@ -184,6 +184,8 @@ class AnnotationModelItem(ModelItem):
|
||||
def data(self, index, role):
|
||||
if role == Qt.DisplayRole and index.column() == 0:
|
||||
return self.type()
|
||||
elif role == TypeRole:
|
||||
return self.type()
|
||||
elif role == DataRole:
|
||||
#print "data():", self.annotation_
|
||||
return self.annotation_
|
||||
|
||||
Reference in New Issue
Block a user