koffice/krita/ui

David Faure faure at kde.org
Fri Sep 1 09:28:21 BST 2006


On Friday 25 August 2006 20:43, Sebastian Sauer wrote:
> SVN commit 577164 by sebsauer:
> 
> Since this is another case where something crashes now at exact the same place deep inside Qt4-snapshot what worked before, I suspect a prob in Qt4 itself... So, seems a Pixmap that isNull() could crash QX11PaintEngine.
> 
> QPainter::begin: Cannot paint on a null pixmap
>  
> Program received signal SIGSEGV, Segmentation fault.
> 0xb652e0e8 in QX11PaintEngine::updatePen (this=0x8a2ca20, pen=@0xbf8c62a4)
>     at painting/qpaintengine_x11.cpp:1284
> 1284        } else if (d->pdev->devType() == QInternal::Pixmap && d->pdev_depth == 32
> (gdb) bt
> #0  0xb652e0e8 in QX11PaintEngine::updatePen (this=0x8a2ca20, pen=@0xbf8c62a4)
>     at painting/qpaintengine_x11.cpp:1284
> #1  0xb652e517 in QX11PaintEngine::updateState (this=0x8a2ca20, state=@0x8a2d9b8)
>     at painting/qpaintengine_x11.cpp:1123
> #2  0xb64d25f7 in QPainterPrivate::updateState (this=0x8a2d610, newState=0x8a2d9b8)
>     at painting/qpainter.cpp:552
> #3  0xb64dab1a in QPainter::eraseRect (this=0xbf8c64d8, r=@0xbf8c6470) at 
> painting/qpainter.cpp:5095
> #4  0xb7ef1a9b in QPainter::eraseRect (this=0xbf8c64d8, x=0, y=0, w=0, h=0)
>     at /opt/qt4-copy/include/QtGui/qpainter.h:632
> #5  0xb7ef71e2 in KisRuler::drawRuler (this=0x8843ef0) at 
> /home/kde4/koffice/krita/ui/kis_ruler.cc:199

You are painting outside of a paint event. Don't do that.
KisRuler needs to be changed to do all its painting in its paintEvent.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list