QPainter logs in stdout
Thiago Macieira
thiago at kde.org
Mon Jan 18 20:17:44 GMT 2010
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+0x146)
> [0x7fe439a9c206] 3:
> /opt/kde4/lib/libkhtml.so.5(_ZN9KHTMLView10paintEventEP11QPaintEvent+0x39)
> [0x7fe429d4fd99] 4:
> /opt/kde4/lib/libkhtml.so.5(_ZN9KHTMLView13viewportEventEP6QEvent+0xfa)
> [0x7fe429d4841a] 5:
> /usr/lib/qt4.5/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate29sendThroug
> 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.
This is where I get lost
#9 0xb6dbc837 in qt_message_output (msgType=QtWarningMsg, buf=0x977ae98
"QPainter::begin: Widget painting can only begin as a result of a paintEvent")
at /home/thiago/src/troll/qt-4.6/src/corelib/global/qglobal.cpp:2227
#10 0xb6dbc9f9 in qt_message (msgType=QtWarningMsg, msg=0xb6a6aeac
"QPainter::begin: Widget painting can only begin as a result of a paintEvent",
ap=0xbf8eda74 "��\216�")
at /home/thiago/src/troll/qt-4.6/src/corelib/global/qglobal.cpp:2273
#11 0xb6dbca81 in qWarning (msg=0xb6a6aeac "QPainter::begin: Widget painting
can only begin as a result of a paintEvent") at
/home/thiago/src/troll/qt-4.6/src/corelib/global/qglobal.cpp:2355
#12 0xb63d6aa4 in QPainter::begin (this=0xbf8edc54, pd=0x94594b8) at
/home/thiago/src/troll/qt-4.6/src/gui/painting/qpainter.cpp:1799
#13 0xb63d583f in QPainter (this=0xbf8edc54, pd=0x94594b8) at
/home/thiago/src/troll/qt-4.6/src/gui/painting/qpainter.cpp:1480
#14 0xb335c6a5 in KHTMLView::paintEvent (this=0x94688e0, e=0xbf8edcfc) at
/home/tmacieir/src/kde4/KDE/kdelibs/khtml/khtmlview.cpp:878
#15 0xb33639cc in KHTMLView::viewportEvent (this=0x94688e0, e=0xbf8ee2a8) at
/home/tmacieir/src/kde4/KDE/kdelibs/khtml/khtmlview.cpp:2129
#16 0xb67e073b in QAbstractScrollAreaPrivate::viewportEvent (this=0x9468ea8,
event=0xbf8ee2a8) at
/home/thiago/src/troll/qt-4.6/src/gui/widgets/qabstractscrollarea_p.h:100
#17 0xb67e0822 in QAbstractScrollAreaFilter::eventFilter (this=0x94584a0,
o=0x8ebd098, e=0xbf8ee2a8) at
/home/thiago/src/troll/qt-4.6/src/gui/widgets/qabstractscrollarea_p.h:116
#18 0xb6edea1f in QCoreApplicationPrivate::sendThroughObjectEventFilters
(this=0x8aa98b0, receiver=0x8ebd098, event=0xbf8ee2a8)
at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.cpp:819
#19 0xb6245c8e in QApplicationPrivate::notify_helper (this=0x8aa98b0,
receiver=0x8ebd098, e=0xbf8ee2a8) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qapplication.cpp:4294
#20 0xb6245b17 in QApplication::notify (this=0xbf8f0b5c, receiver=0x8ebd098,
e=0xbf8ee2a8) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qapplication.cpp:4263
#21 0xb7521497 in KApplication::notify (this=0xbf8f0b5c, receiver=0x8ebd098,
event=0xbf8ee2a8) at
/home/tmacieir/src/kde4/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#22 0xb6ede741 in QCoreApplication::notifyInternal (this=0xbf8f0b5c,
receiver=0x8ebd098, event=0xbf8ee2a8) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.cpp:704
#23 0xb6248475 in QCoreApplication::sendSpontaneousEvent (receiver=0x8ebd098,
event=0xbf8ee2a8) at
../../include/QtCore/../../../../../src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.h:218
#24 0xb62aa437 in QWidgetPrivate::drawWidget (this=0x9421e98, pdev=0x8f8a7d4,
rgn=@0xbf8ee408, offset=@0xbf8ee454, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5322
#25 0xb62aace1 in QWidgetPrivate::paintSiblingsRecursive (this=0x9468ea8,
pdev=0x8f8a7d4, siblings=@0x9468eb4, index=0, rgn=@0xbf8ee628,
offset=@0xbf8ee674, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5435
#26 0xb62aa8a1 in QWidgetPrivate::drawWidget (this=0x9468ea8, pdev=0x8f8a7d4,
rgn=@0xbf8ee628, offset=@0xbf8ee674, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5371
#27 0xb62aace1 in QWidgetPrivate::paintSiblingsRecursive (this=0x946c7e0,
pdev=0x8f8a7d4, siblings=@0x946c7ec, index=2, rgn=@0xbf8ee848,
offset=@0xbf8ee894, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5435
#28 0xb62aa8a1 in QWidgetPrivate::drawWidget (this=0x946c7e0, pdev=0x8f8a7d4,
rgn=@0xbf8ee848, offset=@0xbf8ee894, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5371
#29 0xb62aace1 in QWidgetPrivate::paintSiblingsRecursive (this=0x8ec42d8,
pdev=0x8f8a7d4, siblings=@0x8ec42e4, index=0, rgn=@0xbf8eea68,
offset=@0xbf8eeab4, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5435
#30 0xb62aa8a1 in QWidgetPrivate::drawWidget (this=0x8ec42d8, pdev=0x8f8a7d4,
rgn=@0xbf8eea68, offset=@0xbf8eeab4, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5371
#31 0xb62aace1 in QWidgetPrivate::paintSiblingsRecursive (this=0x8ebd7e8,
pdev=0x8f8a7d4, siblings=@0x8ebd7f4, index=0, rgn=@0xbf8eec88,
offset=@0xbf8eecd4, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5435
#32 0xb62aa8a1 in QWidgetPrivate::drawWidget (this=0x8ebd7e8, pdev=0x8f8a7d4,
rgn=@0xbf8eec88, offset=@0xbf8eecd4, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5371
#33 0xb62aace1 in QWidgetPrivate::paintSiblingsRecursive (this=0x8ec20b0,
pdev=0x8f8a7d4, siblings=@0x8ec20bc, index=0, rgn=@0xbf8eeea8,
offset=@0xbf8eeef4, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5435
#34 0xb62aa8a1 in QWidgetPrivate::drawWidget (this=0x8ec20b0, pdev=0x8f8a7d4,
rgn=@0xbf8eeea8, offset=@0xbf8eeef4, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5371
#35 0xb62aace1 in QWidgetPrivate::paintSiblingsRecursive (this=0x8b90b10,
pdev=0x8f8a7d4, siblings=@0x8b90b1c, index=48, rgn=@0xbf8ef168,
offset=@0x8f8a83c, flags=4, sharedPainter=0x0,
backingStore=0x8f8a818) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5435
#36 0xb62aa8a1 in QWidgetPrivate::drawWidget (this=0x8b90b10, pdev=0x8f8a7d4,
rgn=@0xbf8ef168, offset=@0x8f8a83c, flags=5, sharedPainter=0x0,
backingStore=0x8f8a818)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:5371
#37 0xb64b882c in QWidgetBackingStore::sync (this=0x8f8a818) at
/home/thiago/src/troll/qt-4.6/src/gui/painting/qbackingstore.cpp:1291
#38 0xb62a108e in QWidgetPrivate::syncBackingStore (this=0x8b90b10) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:1663
#39 0xb62b208c in QWidget::event (this=0x8b90920, event=0xbf8efab4) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:8272
#40 0xb67553fa in QMainWindow::event (this=0x8b90920, event=0xbf8efab4) at
/home/thiago/src/troll/qt-4.6/src/gui/widgets/qmainwindow.cpp:1435
#41 0xb761664c in KMainWindow::event (this=0x8b90920, ev=0xbf8efab4) at
/home/tmacieir/src/kde4/KDE/kdelibs/kdeui/widgets/kmainwindow.cpp:1103
#42 0xb7659468 in KXmlGuiWindow::event (this=0x8b90920, ev=0xbf8efab4) at
/home/tmacieir/src/kde4/KDE/kdelibs/kdeui/xmlgui/kxmlguiwindow.cpp:131
#43 0xb7ef0060 in KonqMainWindow::event (this=0x8b90920, e=0xbf8efab4) at
/home/tmacieir/src/kde4/KDE/kdebase/apps/konqueror/src/konqmainwindow.cpp:5639
#44 0xb6245cb2 in QApplicationPrivate::notify_helper (this=0x8aa98b0,
receiver=0x8b90920, e=0xbf8efab4) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qapplication.cpp:4298
#45 0xb6245b17 in QApplication::notify (this=0xbf8f0b5c, receiver=0x8b90920,
e=0xbf8efab4) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qapplication.cpp:4263
#46 0xb7521497 in KApplication::notify (this=0xbf8f0b5c, receiver=0x8b90920,
event=0xbf8efab4) at
/home/tmacieir/src/kde4/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#47 0xb6ede741 in QCoreApplication::notifyInternal (this=0xbf8f0b5c,
receiver=0x8b90920, event=0xbf8efab4) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.cpp:704
#48 0xb6ee2219 in QCoreApplication::sendEvent (receiver=0x8b90920,
event=0xbf8efab4) at
../../include/QtCore/../../../../../src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.h:215
#49 0xb64b51e7 in sendUpdateRequest (widget=0x8b90920, updateImmediately=true)
at /home/thiago/src/troll/qt-4.6/src/gui/painting/qbackingstore.cpp:503
#50 0xb64b5cbb in QWidgetBackingStore::markDirty (this=0x8f8a818,
rect=@0xbf8efbd0, widget=0x94594b0, updateImmediately=true,
invalidateBuffer=false)
at /home/thiago/src/troll/qt-4.6/src/gui/painting/qbackingstore.cpp:641
#51 0xb62b4c3b in QWidget::repaint (this=0x94594b0, rect=@0xbf8efbd0) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:10015
#52 0xb62b4b0d in QWidget::repaint (this=0x94594b0, x=0, y=0, w=1244, h=649)
at /home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:9992
#53 0xb335c241 in KHTMLView::repaintContents (this=0x94688e0, x=0, y=0,
w=1244, h=649) at /home/tmacieir/src/kde4/KDE/kdelibs/khtml/khtmlview.cpp:805
#54 0xb335c2b2 in KHTMLView::repaintContents (this=0x94688e0, r=@0xbf8efccc)
at /home/tmacieir/src/kde4/KDE/kdelibs/khtml/khtmlview.cpp:810
#55 0xb336f0d5 in KHTMLView::timerEvent (this=0x94688e0, e=0xbf8f0694) at
/home/tmacieir/src/kde4/KDE/kdelibs/khtml/khtmlview.cpp:4210
#56 0xb6ef5e26 in QObject::event (this=0x94688e0, e=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qobject.cpp:1204
#57 0xb62b27b2 in QWidget::event (this=0x94688e0, event=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qwidget.cpp:8436
#58 0xb673214c in QFrame::event (this=0x94688e0, e=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/gui/widgets/qframe.cpp:557
#59 0xb67dfac2 in QAbstractScrollArea::event (this=0x94688e0, e=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/gui/widgets/qabstractscrollarea.cpp:989
#60 0xb67e4e5f in QScrollArea::event (this=0x94688e0, e=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/gui/widgets/qscrollarea.cpp:314
#61 0xb335ac61 in KHTMLView::event (this=0x94688e0, e=0xbf8f0694) at
/home/tmacieir/src/kde4/KDE/kdelibs/khtml/khtmlview.cpp:546
#62 0xb6245cb2 in QApplicationPrivate::notify_helper (this=0x8aa98b0,
receiver=0x94688e0, e=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qapplication.cpp:4298
#63 0xb6245b17 in QApplication::notify (this=0xbf8f0b5c, receiver=0x94688e0,
e=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qapplication.cpp:4263
#64 0xb7521497 in KApplication::notify (this=0xbf8f0b5c, receiver=0x94688e0,
event=0xbf8f0694) at
/home/tmacieir/src/kde4/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#65 0xb6ede741 in QCoreApplication::notifyInternal (this=0xbf8f0b5c,
receiver=0x94688e0, event=0xbf8f0694) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.cpp:704
#66 0xb6ee2219 in QCoreApplication::sendEvent (receiver=0x94688e0,
event=0xbf8f0694) at
../../include/QtCore/../../../../../src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.h:215
#67 0xb6f1908a in QTimerInfoList::activateTimers (this=0x8aac6a4) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qeventdispatcher_unix.cpp:603
#68 0xb6f14f70 in timerSourceDispatch (source=0x8aac670) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qeventdispatcher_glib.cpp:184
#69 0xb6f15029 in idleTimerSourceDispatch (source=0x8aacb00) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qeventdispatcher_glib.cpp:231
#70 0xb5b1db92 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#71 0xb5b21468 in ?? () from /usr/lib/libglib-2.0.so.0
#72 0xb5b2158e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#73 0xb6f1611c in QEventDispatcherGlib::processEvents (this=0x8aa9870, flags={i
= 36}) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qeventdispatcher_glib.cpp:412
#74 0xb631ac46 in QGuiEventDispatcherGlib::processEvents (this=0x8aa9870,
flags={i = 36}) at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#75 0xb6edbb1b in QEventLoop::processEvents (this=0xbf8f095c, flags={i = 36})
at /home/thiago/src/troll/qt-4.6/src/corelib/kernel/qeventloop.cpp:149
#76 0xb6edbc60 in QEventLoop::exec (this=0xbf8f095c, flags={i = 0}) at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qeventloop.cpp:201
#77 0xb6edee1d in QCoreApplication::exec () at
/home/thiago/src/troll/qt-4.6/src/corelib/kernel/qcoreapplication.cpp:981
#78 0xb6243002 in QApplication::exec () at
/home/thiago/src/troll/qt-4.6/src/gui/kernel/qapplication.cpp:3577
#79 0xb7f3fd33 in kdemain (argc=1, argv=0xbf8f0e84) at
/home/tmacieir/src/kde4/KDE/kdebase/apps/konqueror/src/konqmain.cpp:257
#80 0x080485db in main (argc=1, argv=0xbf8f0e84) at
/home/tmacieir/obj/kde4/KDE/kdebase/apps/konqueror/src/konqueror_dummy.cpp:3
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100118/cabeefe6/attachment.sig>
More information about the kde-core-devel
mailing list