mirror of
https://github.com/wassname/sloth.git
synced 2026-07-01 15:45:21 +08:00
Merge branch 'master' of github.com:cvhciKIT/sloth
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
doc/_build/*
|
||||
*.pyc
|
||||
.*.swp
|
||||
*.py~
|
||||
build/*
|
||||
|
||||
@@ -287,7 +287,7 @@ class LabelTool(QObject):
|
||||
|
||||
current = self._current_image
|
||||
if current is None:
|
||||
current = self._model.iterator(ImageModelItem).next()
|
||||
current = next(self._model.iterator(ImageModelItem))
|
||||
|
||||
next_image = current.getSibling(idx)
|
||||
if next_image is not None:
|
||||
@@ -298,7 +298,7 @@ class LabelTool(QObject):
|
||||
if self._current_image is not None:
|
||||
next_image = self._current_image.getNextSibling(step)
|
||||
else:
|
||||
next_image = self._model.iterator(ImageModelItem).next()
|
||||
next_image = next(self._model.iterator(ImageModelItem))
|
||||
if next_image is not None:
|
||||
next_image = next_image.getNextSibling(step-1)
|
||||
|
||||
@@ -429,6 +429,10 @@ class LabelTool(QObject):
|
||||
def selectPreviousAnnotation(self):
|
||||
if self._mainwindow is not None:
|
||||
return self._mainwindow.scene.selectNextItem(reverse=True)
|
||||
|
||||
def selectAllAnnotations(self):
|
||||
if self._mainwindow is not None:
|
||||
return self._mainwindow.scene.selectAllItems()
|
||||
|
||||
def deleteSelectedAnnotations(self):
|
||||
if self._mainwindow is not None:
|
||||
|
||||
@@ -260,6 +260,10 @@ class AnnotationScene(QGraphicsScene):
|
||||
item.setSelected(True)
|
||||
break
|
||||
|
||||
def selectAllItems(self):
|
||||
for item in self.items():
|
||||
item.setSelected(True)
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
LOG.debug("keyPressEvent %s" % event)
|
||||
|
||||
|
||||
@@ -48,10 +48,7 @@ class BackgroundLoader(QObject):
|
||||
self._message_displayed = True
|
||||
if self._level <= self._max_levels and self._rows > 0:
|
||||
try:
|
||||
if hasattr(self._iterator, "next"):
|
||||
item = self._iterator.next()
|
||||
else:
|
||||
item = next(self._iterator)
|
||||
item = next(self._iterator)
|
||||
self._next_rows += item.rowCount()
|
||||
self._pos += 1
|
||||
self._progress.setValue(int((float(self._pos) / float(self._rows) + self._level - 1) * 1000))
|
||||
|
||||
@@ -179,11 +179,7 @@ class DefaultAttributeHandler(QGroupBox, AbstractAttributeHandler):
|
||||
self._inputField.setPlaceholderText(", ".join(selected_values))
|
||||
elif len(selected_values) == 1:
|
||||
it = iter(selected_values)
|
||||
if hasattr(it, 'next'):
|
||||
self._inputField.setText(it.next())
|
||||
else:
|
||||
self._inputField.setText(next(it))
|
||||
|
||||
self._inputField.setText(next(it))
|
||||
|
||||
def updateButtons(self):
|
||||
selected_values = self.getSelectedValues()
|
||||
|
||||
Reference in New Issue
Block a user