mirror of
https://github.com/wassname/sloth.git
synced 2026-07-19 11:28:06 +08:00
add prefix, commit and annotation properties to the base inserter
This commit is contained in:
@@ -10,11 +10,26 @@ class ItemInserter(QObject):
|
||||
annotationFinished = pyqtSignal()
|
||||
inserterFinished = pyqtSignal()
|
||||
|
||||
def __init__(self, labeltool, scene, default_properties=None):
|
||||
def __init__(self, labeltool, scene, default_properties=None, prefix="", commit=True):
|
||||
QObject.__init__(self)
|
||||
self._labeltool = labeltool
|
||||
self._scene = scene
|
||||
self._default_properties = default_properties
|
||||
self._prefix = prefix
|
||||
self._ann = {}
|
||||
if default_properties is not None:
|
||||
self._ann = dict(self._default_properties.iteritems())
|
||||
self._commit = commit
|
||||
self._item = None
|
||||
|
||||
def annotation(self):
|
||||
return self._ann
|
||||
|
||||
def item(self):
|
||||
return self._item
|
||||
|
||||
def pen(self):
|
||||
return Qt.red
|
||||
|
||||
def mousePressEvent(self, event, image_item):
|
||||
event.accept()
|
||||
|
||||
Reference in New Issue
Block a user