c++qtqtableviewqstandarditemmodel

How to remove the vertical header in QStandardItemModel?


I have created a table using QTableView and a QStandardItem widget. How to remove the vertical header from QStandardItemModel?


Solution

  • Use the header's hide() method:

    QTableView * view = new QTableView();
    view->verticalHeader()->hide();
    

    Don't forget to #include <QHeaderView>.