Unsolved QTableView, frozen column
-
Hi,
Struggling with a QTableView with frozen column implementation.
It's pretty much a copy/paste of the Frozen Column Example in the documentation.
My problem is that when the column is frozen the vertical scrolling does not sync with the main table.
Especially when add, remove rows in the table (model), as well as setting filter to the model.Calling the updateFrozenTableGeometry() function in the example works when adding or removing rows. But not when setting filter.
If i resize mainwindow the scrolling gets sync, and all works fine (until changing filter).
Anyone with a solution?
Some signal emitted during mainwindow resize obviously fix my problem, but which one. (update(), repaint() has be tested)Thx,
T -
Hi,
How exactly are you doing the filtering ?
-
QSqlRelationTableModel::setFilter()
-
How are you freezing the column ?
-
As said : https://doc.qt.io/qt-5/qtwidgets-itemviews-frozencolumn-example.html
I do not have the possibility to share my code.
-
Are both table views in the frozen column setup are connected to the same QSqlRelationTableModel instance (correct), or have you connected them to two separate instances (not correct) ?
-
Yes it's the same instance.
I found an ugly fix I think I will go for. Due to struggling enough for now...
When setting filter and frozen column option is active, I manually run hide() then show() on the frozen table view.