Updating Scrollbar QTableView when model shrink
I have a model that dynamically shrinks and grows depending on user inputs and it is display in a tableview... the problem I'm having is that the scrollbars are never updated... they are set to the size of the data when I call setModel().. but when the model shrinks I can still scroll past the new smaller data... I've tried calling reset() and update() on the tableview but it has no effect on the scrollbar... How can I update the scrollbar so that it doesn't go past the size of the data??
Sounds like a glitch, what version of Qt are you using ? On which platform ?
@SGaist I'm using the latest version of Qt on windows 10
If you are using custom model, it mostly likely a sign that model does not call appropriate required functions which are used for notification about data changes.
@alex_malyu Yes, it is a custom model... and you are right I do not call any function when I change the data... I simply have a setter function that sets the model data... how should I go about changing the data??
@alex_malyu The custom model derives from QAbstractTableModel btw...
functions of interest typically start with begin...., end...
void beginInsertRows(const QModelIndex & parent, int first, int last)
void beginRemoveRows(const QModelIndex & parent, int first, int last)