How do you trigger the paintEvent? By calling update? Or dont't you trigger it by yourself and only let Qt trigger it when neccessary?
How do you trigger the paintEvent? By calling update? Or dont't you trigger it by yourself and only let Qt trigger it when neccessary?
It's nice to be important but it's more important to be nice.
I'm letting Qt call the event whenever it wants to. It seems to do it whenever a cell is selected or deselected and when it is moved. The function is definitely being called though.
I can even reproduce the problem in a minimal program where the only thing I do is create the custom table and try to draw in it's paintEvent function.
From http://doc.trolltech.com/4.1/qabstra...tml#paintEvent
Maybe this helpsvoid QAbstractScrollArea:aintEvent ( QPaintEvent * event ) [virtual protected]
This event handler can be reimplemented in a subclass to receive paint events (passed in event), for the viewport() widget.
Note: If you open a painter, make sure to open it on the viewport().
Reimplemented from QWidget.
See also QWidget:aintEvent().
It's nice to be important but it's more important to be nice.
Corran (30th December 2006)
That sorted it, thanks a lot. I'd only read the QWidget paintEvent documentation. It didn't occur to me that it would be subclassed halfway through the system like that.
Bookmarks