diff --git a/clusterview/mode_handlers.py b/clusterview/mode_handlers.py index 97bef83..fc764fc 100644 --- a/clusterview/mode_handlers.py +++ b/clusterview/mode_handlers.py @@ -144,6 +144,10 @@ def ogl_keypress_handler(ctx, event): PointManager.point_set.clear_selection() reset_move_bbs() + elif ctx.mode in [Mode.ADD, Mode.EDIT, Mode.DELETE, Mode.OFF]: + # Just clear selections + PointManager.point_set.clear_selection() + elif ctx.mode is not Mode.OFF: ctx.mode = Mode.OFF diff --git a/clusterview/opengl_widget.py b/clusterview/opengl_widget.py index b6af2ca..d8fafcd 100644 --- a/clusterview/opengl_widget.py +++ b/clusterview/opengl_widget.py @@ -89,7 +89,6 @@ def set_drawing_mode(mode): __current_mode = mode - def set_drawing_event(event): """ State machine event management function. diff --git a/clusterview/point_list_widget.py b/clusterview/point_list_widget.py index 8ed3587..2e330e8 100644 --- a/clusterview/point_list_widget.py +++ b/clusterview/point_list_widget.py @@ -25,7 +25,7 @@ def __string_point_to_point(str_point): x = elems[0][1:] y = elems[1][1:-1] - return (x, y) + return (int(x), int(y)) def item_click_handler(ctx, item): """ diff --git a/main_window.py b/main_window.py index 6487651..8acd62f 100644 --- a/main_window.py +++ b/main_window.py @@ -48,7 +48,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): # Same story here but this time with the itemClicked event # so that when an element is clicked on in the point list it will # highlight. - self.point_list_widget.itemClicked = partial(item_click_handler, self) + self.point_list_widget.itemClicked.connect(partial(item_click_handler, + self)) #----------------------------------------------- # OpenGL Graphics Handlers are set