How to draw and correctly animate progress bar in QTableView?
-
@hamov said:
Also found out the same effect can happen by simply call
m_model->reset() from main window.
But that is bad for a tree since it resets all open states etc.I think one is to use the
void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ())
From (inside?) the model for optimized redrawing.
I agree with you.
Repaint should still repaint even if model is not dirty. Also it redraws on mousemove even
model is not changed so a bit odd that it then ignores direct repaints .You are right.
I guess we can add to the conclusion
that if you have no data/very static , the Item-based ListWidget might work better (?)update:
ListWidget suffer the same. update/repaint does nothing.
So not sure how one would go about asking it to redraw. -
well digging around, I also found
m_list->viewport()->repaint();which works for WidgetList. Did not test with model/view yet.
I think it is by design as it does redraw when data changes but we are not alone finding
it strange working if one google it