Abdelrazak Younes wrote: > Peter Kümmel wrote: >> Abdelrazak Younes wrote: >>>> I don't think we could just delete it, it's in use, but I will try. >>> Indeed. Sorry I did not understand your question. Let's going back to >>> the beginning, we have: >>> >>> verticalScrollBar()->setPageStep(viewport()->height()); >>> >>> Should do nothing >>> >>> paint_device_ = QPixmap(viewport()->width(), viewport()->height()); >>> >>> I guess the resizeEvent happens during a paintEvent. This should not >>> happen because paintEvent has priority other all other events. This >>> seems like a bug of the Qt4/MSVC patch to me. >>> >>> view_.view()->workAreaResize(); >>> >>> This involves a new drawing... >>> >>> Abdel. >> >> An other point is, you see only a wrong resize when you've >> scrolled the document before resizing, but not every scrolling >> gives you the wrong behaviour, very wired. > > My conclusion: > > verticalScrollBar()->setPageStep(viewport()->height()); > > actually do something! I am astonished that inverting the two lines > won't solve the problem. > > Abdel. > >
At least I'm now 100% sure this is the right place to look for the bug: I've tested your shared_ptr solution, and the resize bug is gone, but I get-as assumed-this from Qt: :) QPaintDevice: Cannot destroy paint device that is being painted. Be sure to QPainter::end() painters!