Solved How to change widget in QMainWindow
-
I have a QMainWindow with a tree view on the left hand side. On the right had side there should be different widgets depending on the selection of the tree view. When the user selects a row from the tree view, the widget on the right hand side should change. How can I achieve this?
-
Hi,
You can use a QStackedWidget and associate the index of each widget in it to the corresponding item in your QTreeView. So when you click on an item of your tree, you trigger the selection of the corresponding index in your QStackedWidget.
-
@SGaist Perfect. That is what I was looking for. Thank you very much.