Skip to content

Conversation

@aaronayres35
Copy link
Contributor

This PR adds UITester support for the qt TreeEditor. Note that some of the changes made here are identical to those made in #1707 (ie _interaction_helpers that work with QAbstractItemModel). This PR also currently adds a simple test for the TreeEditor_demo but I have not yet updated actual Tree Editor tests.

Checklist

  • Add a news fragment if this PR is news-worthy for end users. (see docs/releases/README.rst)

Comment on lines +73 to +84
tree_widget = self.source._tree
i_column = self.location.column
i_rows = iter(self.location.row)
item = tree_widget.topLevelItem(next(i_rows))
for i_row in i_rows:
item = item.child(i_row)
q_model_index = tree_widget.indexFromItem(item, i_column)
return dict(
model=tree_widget.model(),
view=tree_widget,
index=q_model_index,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic and the TreeNode object having a row/column I need to think about more carefully. I had this code in a branch locally from a long time ago which I believe had originally been pulled from one of Kit's draft PRs.

There may be a simple way to do this / at the very least I need to better document the TreeNode class to say what row and column actually specify. In this case (see test_TreeEditor_demo.py) row is a tuple containing the index of the node of interest at subsequent levels of the tree, and column is the index at that last level (?). I have just been using column as 0, ... it may be possible we only need one single tuple to do this TreeNode location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant