Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to add Combobox at the top of treeview
Indrajeet last edited by
I want to add the combobox at the top of tree view and depending upon the selection of the items from that combobox
I want to show different treeviews how to do this?
andre last edited by
One way is to use a [[doc:QStackedWidget]], and create a page with a QTreeView for each of the items in your combobox. Then, let the selectedIndex of the combobox determine the currentIndex() of the widget stack.
Or, if it really is the model in the view you'd like to change, do exactly that: use a single QTreeView, and simply add a bit of code to change the model you're using for the view based on the selected item in the combo box.