In general, a module should not initiate switching to another module, as each module should implement a particular feature completely. If you are working on a module that performs a complex workflow then you can place all relevant widgets in your module GUI.
For example, if you want to show a data tree then you don’t switch to the data module, just add a data tree to the widget of your module:
v = slicer.qMRMLSubjectHierarchyTreeView()
v.setMRMLScene(slicer.mrmlScene)
v.show()
You can customize what columns are shown in the tree, filter which items are displayed, define actions that are performed when the user selects an item, etc.
If you still think that switching modules is appropriate (e.g., at the end of your workflow), you can do what is done in the Welcome module:
Hello indeed maybe it’s the best solution, but i did not manage to get it work.
I added qMRMLSubjectHierarchyTreeView to my module widget but i couldn’t get to the actual dataTree. What would be a C++ equivalent of v = slicer.qMRMLSubjectHierarchyTreeView(), i did not found a tree view in qSlicerApplication::**** .
If you start Qt designer (Slicer.exe --designer) then qMRMLSubjectHierarchyTreeView should show up in the widget list and you can just drag-and-drop it into your GUI.