MistyD
MistyD

Reputation: 17223

How to access QHeaderView::sectionsInserted slot

I wanted to know how I can gain access to the sectionsInserted slot.I need access to the parameters of that method. Since it is a protected slot I think I would need to inherit from QHeaderView. Now even if I inherit from QheaderView how would I attach that Qheaderview to my tableview ?

Upvotes: 1

Views: 109

Answers (2)

Pavel Strakhov
Pavel Strakhov

Reputation: 40502

You should use QAbstractItemModel::columnsInserted or QAbstractItemModel::rowsInserted signals instead. They have exactly the same signature. I believe they are connected to the QHeaderView::sectionsInserted slot.

Subclassing QHeaderView will not help you. QHeaderView::columnsInserted is not virtual, so your implementation will not be called by Qt.

Upvotes: 1

Frank Osterfeld
Frank Osterfeld

Reputation: 25155

You can set the vertical and horizontal headers of a QTableView with QTableView::setVerticalHeader() and QTableView::setHorizontalHeader(), respectively.

Upvotes: 1

Related Questions