Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.2.0
-
None
Description
QAbstractScrollArea derived class, QTableWidget for example, won't fire paintEvent when update() is called, (repaint, updateGeometry, etc - won't work too).
I.e.:
QTableWidget* w = new ...;
...
w->update();
won't work.
Workaround:
if(auto a = dynamic_cast<QAbstractScrollArea*>(w))
a->viewport()->update();
else
w->update();
The attached file contains app reproducing this problem.
How to use this app:
Click ‘check_paint_cnt’ – status bar shows “paint_cnt = 1” (so paintEvent is called once)
Click ‘call_update’
Click ‘check_paint_cnt’ again – status bar shows “paint_cnt = 1”, but should be 2…
Resizing the main window do increases paint_cnt.
Detailed discussion is here: http://qt-project.org/forums/viewthread/41319/#171389
and here
http://stackoverflow.com/questions/22996185/qt-5-2-calling-qtablewidgetupdate-does-not-result-in-qtablewidgetpaintevent