How to select multiple layers?

There is an API selectedNodes() that returns all selected nodes.

However, how to select multiple nodes (for example, multiple layers) at the first place?

I’ve only found setActiveNode(), which seems to select only one layer.

I know it is not a very pretty code, but this is the way to do it.
You can manipulate the selection state by specifying the Id or name of the layers you want to select and placing them in the QItemSelectionModel.

1 Like

I think you can only have one active node at a time but you can use that list to cycle though them.