-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] UITester support for qt TreeEditor #1713
base: main
Are you sure you want to change the base?
Conversation
…subclasses QTreeView
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, | ||
) |
There was a problem hiding this comment.
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.
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 withQAbstractItemModel
). This PR also currently adds a simple test for theTreeEditor_demo
but I have not yet updated actual Tree Editor tests.Checklist