Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QHeaderView: get numeric column index by name



  • Hi,
    is it possible to get the column index number by a column textual name? I don't find any functionality like this.



  • You might want to get the underlying model with model() and search that with QAbstractItemModel::match().

    If that does not help, you could iterate through the QAbstractItemModel::headerData() results.


Log in to reply