How to remove the vertical header in QStandardItemModel?
Asked Answered
A

1

13

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

Almazan answered 5/9, 2013 at 7:26 Comment(1)
You don't remove it from the model, you hide it in the viewPrecinct
M
25

Use the header's hide() method:

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

Don't forget to #include <QHeaderView>.

Malchy answered 5/9, 2013 at 7:33 Comment(1)
For QTreeView, use treeView->header()->hide()Cherilyncherilynn

© 2022 - 2024 — McMap. All rights reserved.