QPainter logs in stdout

Ingo Klöcker kloecker at kde.org
Mon Jan 18 21:17:33 GMT 2010


On Monday 18 January 2010, Thiago Macieira wrote:
> Em Segunda-feira 18. Janeiro 2010, às 20.50.12, Jaime Torres escreveu:
> > I have much more info now.
> >
> > I've modified Qt4.6.1 (yes, installed in /usr/lib/qt4.5) to include
> > a kbactrace after every qwarning in QPaint, and here you are why it
> > happens. But I get lost and can not fix it.
> >
> >
> > QPainter::begin: Widget painting can only begin as a result of a
> > paintEvent [
> > 0: /usr/lib/qt4.5/lib/libQtGui.so.4 [0x7fe439a965d8]
> > 1:
> > /usr/lib/qt4.5/lib/libQtGui.so.4(_ZN8QPainter5beginEP12QPaintDevice
> >+0x5ea) [0x7fe439a9ba9a] 2:
> > /usr/lib/qt4.5/lib/libQtGui.so.4(_ZN8QPainterC1EP12QPaintDevice+0x1
> >46) [0x7fe439a9c206] 3:
> > /opt/kde4/lib/libkhtml.so.5(_ZN9KHTMLView10paintEventEP11QPaintEven
> >t+0x39) [0x7fe429d4fd99] 4:
> > /opt/kde4/lib/libkhtml.so.5(_ZN9KHTMLView13viewportEventEP6QEvent+0
> >xfa) [0x7fe429d4841a] 5:
> > /usr/lib/qt4.5/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate29sen
> >dThroug hObjectEventFiltersEP7QObjectP6QEvent+0xc0) [0x7fe43af16900]
> > 6:
>
> Here's the same as a backtrace in gdb. To reproduce:
>
> QT_FATAL_WARNINGS=1 konqueror http://qt.nokia.com
>
> As you can see from the backtrace, KHTMLView::viewportEvent creates a
> QPaintEvent and calls paintEvent. That's what causes the issue.
>
> However, given the documentation for
> QAbstractScrollArea::viewportEvent as well as the implementation in
> Qt, it would seem that paint events are allowed.

Is this supposed to trigger an immediate repaint? If yes, then IIRC in a 
similar situation (on Windows) we also tried to use paintEvent(). It 
didn't work. After digging into Qt's sources we finally resorted to 
something like
  QEvent event( QEvent::UpdateRequest );
  QCoreApplication::postEvent( viewport, &event );
instead.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100118/5f6efe62/attachment.sig>


More information about the kde-core-devel mailing list