From kde-commits Tue Oct 12 22:38:20 2010 From: David Faure Date: Tue, 12 Oct 2010 22:38:20 +0000 To: kde-commits Subject: KDE/kdelibs/khtml Message-Id: <20101012223820.EF8CEAC895 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=128692313819823 SVN commit 1185322 by dfaure: Fix warnings "QPainter::begin: Widget painting can only begin as a result of a paintEvent" on pages with form widgets (testcase: https://bugs.kde.org/query.cgi). The reason is that viewportEvent() is supposed to draw on the viewport, but khtmlview would try to call paintEvent() to draw on widget() from there, and QPainter didn't expect that, so nothing gets drawn anyway. Clearly the painting is happening anyway, from the eventFilter on widget(), so this isn't needed. Confirmed by Germain Garand long ago. M +0 -11 khtmlview.cpp --- trunk/KDE/kdelibs/khtml/khtmlview.cpp #1185321:1185322 @@ -2135,17 +2135,6 @@ case QEvent::DragLeave: case QEvent::Drop: return false; - case QEvent::Paint: { - QRect r = static_cast(e)->rect(); - r = r.intersect( widget()->rect() ); - if (r.isValid() && !r.isEmpty()) { - r.setX(r.x() +contentsX()); - r.setY(r.y() +contentsY()); - QPaintEvent pe(r); - paintEvent(&pe); - } - return true; - } default: break; }