Skip to content

Commit

Permalink
Fix index count
Browse files Browse the repository at this point in the history
  • Loading branch information
kitchoi committed Aug 4, 2020
1 parent f5d2cfe commit 9362617
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion traitsui/examples/demo/Advanced/List_editors_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class ListTraitTest(HasStrictTraits):
with tester.create_ui(demo) as ui:
main_tab = tester.find_by_id(ui, "splitter")
main_tab.locate(locator.Index(1)).perform(command.MouseClick())
list_ = tester.find_by_id(ui, "list").locate(locator.Index(1))
list_ = tester.find_by_id(ui, "list").locate(locator.Index(3))
list_.find_by_name("name").perform(command.KeySequence("\b\b\b\bDavid"))

main_tab.locate(locator.Index(2)).perform(command.MouseClick())
Expand Down
3 changes: 2 additions & 1 deletion traitsui/testing/qt4/default_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def mouse_click_index_with_layout(interactor, action):

def nested_ui_index_with_custom_list_editor(interactor, action):
index = interactor.location.index
row, column = divmod(index, interactor.editor.factory.columns)
grid_layout = interactor.editor._list_pane.layout()
widget = grid_layout.itemAt(index).widget()
widget = grid_layout.itemAtPosition(row, column).widget()
return widget._editor._ui


Expand Down

0 comments on commit 9362617

Please sign in to comment.