My SuperTable
class inherits from QTableView
, who, in turn, inherits from QAbstractItemView
.
At some point, the QTableView
's QScrollBar
emits a signal that triggers the QAbstractItemView::verticalScrollbarValueChanged(int)
slot.
For my application, it's important this doesn't happen, so I'd like to disconnect that slot in QAbstractItemView
, but I haven't been able to find a way to gain access to it from SuperTable
.
edit/
What I'm trying to achieve: the table model's data is no longer available, but I want to keep the dialog with the QTableView and the data it already contains, available. But I can't have its data()
method be called, because I don't have anything to return anymore.
For the most part, I've accomplished this, with one big exception: whenever the table is scrolled with the mouse over the cells, the following happens:
myApp::SuperTable::data(QModelIndex const&, int) const
QSortFilterProxyModel::data(QModelIndex const&, int) const
QAbstractItemViewPrivate::checkMouseMove(QPersistentModelIndex const&) QAbstractItemView::verticalScrollbarValueChanged(int)
QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
QAbstractSlider::valueChanged(int)
/edit
More specifically, peeking at Qt's implementation of qabstractitemview.cpp, this is the connection I'd like to disconnect:
void QAbstractItemViewPrivate::init()
{
// (...)
QObject::connect(vbar, SIGNAL(valueChanged(int)),
q, SLOT(verticalScrollbarValueChanged(int)));
// (...)
}
Since it's on the private side of things, unsure whether this is even possible. Is there a way?