When there are a few rows/columns (but not that many, I tested it with 300 items and 12 columns) in a QML TableView, the associated performance of a scroll are generally bad, with frame drops and little freezes.
When looking at the source of the internal delegate of TableView, TableViewItemDelegateLoader.qml, we can see the following code:
We can see here that the sourceComponent property depends on styleData.row. Since delegates are reused in QML TableView, this property (styleData.row) changes a lot during scrolls, leading to creation and destruction of delegates, and lags.
Technically, the sourceComponent property effectively creates/destroys a component only on change of the QQuickComponent, so it should not do anything, BUT It appears that styleData.row is frequently set to -1 during scroll (when reusing components, it changes), leading to component creations/destruction.
By changing the code to:
I don't see any visual change/error and I don't see the lags anymore (at least not with this amount of data). It's probably not the right way to fix it, but can something be done about this?