-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
add setCurrentNode to qgslayertreeview #58822
add setCurrentNode to qgslayertreeview #58822
Conversation
I think we should drop the redundant setCurrentGroup method, just to keep the API from becoming cluttered. Otherwise +1 |
Figured as much, wasn't sure. Removed setCurrentGroup. |
@ViperMiniQ this looks good, it's just the failing code format checks which need fixing now |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
Superseded by #58822 |
QgsLayerTreeView has a method (setCurrentLayer) for setting the QgsLayerNode as active in the tree by passing the layer to it.
There is no method for selecting groups the same way, even though the method setCurrentLayer finds the QgsLayerTreeNode and passes it to a function which selects the node.
2 new methods are added:
setCurrentNode - a general way of setting active nodes, which both setCurrentGroup and setCurrentLayer will call. Also, since a layerTreeView.selectedNodes() method returns selected nodes, it would make sense to have a method for selecting them as well.
setCurrentGroup - to have an exact way of setting active groups alongside active layers, even though maybe having setCurrentNode only would be ideal. Removing setCurrentLayer would not make sense now, so adding this as well.
Would close #47337