mirror of
https://github.com/wassname/sloth.git
synced 2026-09-10 12:31:29 +08:00
Fix going to next/previous frame/image
This commit is contained in:
@@ -53,7 +53,7 @@ class ModelItem:
|
|||||||
p = self.parent()
|
p = self.parent()
|
||||||
if p is not None:
|
if p is not None:
|
||||||
row = p.getPosOfChild(self)
|
row = p.getPosOfChild(self)
|
||||||
if row < len(p.children()) - 2:
|
if row < len(p.children()) - 1:
|
||||||
return p.getChildAt(row+1)
|
return p.getChildAt(row+1)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -250,16 +250,16 @@ class LabelTool(QObject):
|
|||||||
return self._model
|
return self._model
|
||||||
|
|
||||||
def gotoNext(self):
|
def gotoNext(self):
|
||||||
# TODO move this to the scene
|
|
||||||
if self._model is not None and self._current_image is not None:
|
if self._model is not None and self._current_image is not None:
|
||||||
next_image = self._current_image.getNextSibling()
|
next_image = self._current_image.getNextSibling()
|
||||||
self.setCurrentImage(next_image)
|
if next_image is not None:
|
||||||
|
self.setCurrentImage(next_image)
|
||||||
|
|
||||||
def gotoPrevious(self):
|
def gotoPrevious(self):
|
||||||
# TODO move this to the scene
|
|
||||||
if self._model is not None and self._current_image is not None:
|
if self._model is not None and self._current_image is not None:
|
||||||
prev_image = self._current_image.getPreviousSibling()
|
prev_image = self._current_image.getPreviousSibling()
|
||||||
self.setCurrentImage(prev_image)
|
if prev_image is not None:
|
||||||
|
self.setCurrentImage(prev_image)
|
||||||
|
|
||||||
def updateModified(self):
|
def updateModified(self):
|
||||||
"""update all GUI elements which depend on the state of the model,
|
"""update all GUI elements which depend on the state of the model,
|
||||||
|
|||||||
Reference in New Issue
Block a user