orbit orbit - 1 month ago 7
C++ Question

How do I debug the inner workings of QTableView?

If I have a

QTableView
and I want to step through the code that gets executed when I click a column header, how would I do that? Where should I be putting my breakpoint to see inside of the inner workings of
QTableView
? For example, I know that clicking a column header in the table will sort the column when sorting is enabled. But how do I see this happen and actually step through the code for
QTableView
?

Answer

The class you're looking for is QHeaderView. You can begin by setting a breakpoint in void QHeaderView::mousePressEvent(QMouseEvent*).