mirror of
https://github.com/wassname/sloth.git
synced 2026-08-11 05:53:17 +08:00
Make default hotkeys work
This commit is contained in:
@@ -15,6 +15,7 @@ if __name__ == '__main__':
|
||||
labeltool.execute_from_commandline(sys.argv)
|
||||
|
||||
wnd = MainWindow(labeltool)
|
||||
labeltool._mainwindow = wnd
|
||||
wnd.show()
|
||||
|
||||
sys.exit(app.exec_())
|
||||
|
||||
@@ -66,6 +66,7 @@ class LabelTool(QObject):
|
||||
self.container_ = AnnotationContainer()
|
||||
self._current_image = None
|
||||
self._model = AnnotationModel([])
|
||||
self._mainwindow = None
|
||||
|
||||
def main_help_text(self):
|
||||
"""
|
||||
@@ -329,3 +330,18 @@ class LabelTool(QObject):
|
||||
i += 1
|
||||
|
||||
self._model._root.appendFileItem(fileitem)
|
||||
|
||||
###
|
||||
### Scene functions
|
||||
###___________________________________________________________________________________________
|
||||
def selectNextAnnotation(self):
|
||||
if self._mainwindow is not None:
|
||||
return self._mainwindow.scene.selectNextItem()
|
||||
|
||||
def selectPreviousAnnotation(self):
|
||||
if self._mainwindow is not None:
|
||||
return self._mainwindow.scene.selectNextItem(reverse=True)
|
||||
|
||||
def exitInsertMode(self):
|
||||
if self._mainwindow is not None:
|
||||
return self._mainwindow.buttonarea.exitInsertMode()
|
||||
|
||||
Reference in New Issue
Block a user