Browse Source

Get highlighting to work on item list clicking

tb-init-ui-render
Taylor Bockman 5 years ago
parent
commit
169e6dd348
  1. 4
      clusterview/mode_handlers.py
  2. 1
      clusterview/opengl_widget.py
  3. 2
      clusterview/point_list_widget.py
  4. 3
      main_window.py

4
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

1
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.

2
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):
"""

3
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

Loading…
Cancel
Save