Vincent van Ravesteijn - TNW wrote:
Wouldn't it be natural to resize the bufferView and update the
scrollbars in resizeEvent and only paint the bufferView in paintEvent
?
No, beacuse a BufferView resize is basically just a full repaint and
there should be no paint operation inside the resizeEvent, and the
BufferView resize involves a painting operation onto a Pixmap. I
explicitely remove any painting from the resizeEvent and delayed the
BufferView resize until the next paint event because of that.
Yes, I know that, I looked at revision 16499 (IIRC).
But: BufferView::resize() does not involve painting anything right ?
Just setting the width_ and height_ of the bufferView. I feel like this
shouldn't be done inside paintEvent. You could do this and update the
scrollbars in resizeEvent ?
Right ? Please tell me where I'm wrong.
I just had a look and right, you're right, it used to contain a full
redraw in addition to the metrics update but not anymore... Looks like I
am forgetting my own cleanup :-)
A paintEvent will follow to paint the new bufferView.
Yep, right, it should work. Anyway, just try to move the resize call.
Make sure to test it with Qt4.4 and 4.5, or have somone test it for you
(testing with 4.3 would not hurt too). This area is not so robust across
QT versions.
Sorry for doubting you Vincent but a deeper explanation never hurts ;-)
Abdel.