Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to get column index from column name in QTreeview
Qt Enthusiast last edited by
I have a Qtreeview , I want to get column index if I input has column name in QTreeview
Can you explain your current situation with more details ?
JonB last edited by
QTreeViewhas a model. The model has columns with names. (You may or may not also have used
QTreeView::setHeader(), which uses a
QHeaderView.) Iterate (search) the model's columns for the one you want, that will give you the column index used in the
QTreeView. Is that what you mean?