[CRASH] QGraphicsView::mapFromScene buggy

Aaron J. Seigo aseigo at kde.org
Mon Oct 20 21:56:16 CEST 2008


On Monday 20 October 2008, Alex Merry wrote:
> On Monday 20 October 2008 10:34:54 Alexis Ménard wrote:
> > QSize s = dialog->size();
> > QPoint pos = q->view()->mapFromScene(q->scenePos());
> >
> > Here is the code from popup applet. Three things that can crash :
> >
> > First q->view() return null so you call mapFromScene to a null or broken
> > pointer. Run gdb and test the variable (or print it with kDebug).
> >
> > Second, q->scenePos() return crazy value (check).
> >
> > Third, q is null or broken. Test.
>
> Since the crash was in mapFromScene(), q is certainly not the problem.  I
> doubt a crazy value from q->scenePos() would cause a segfault.  So the
> problem is almost certainly the result of q->view().

yep, and its fixed in trunk.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081020/a4c18829/attachment.sig 


More information about the Plasma-devel mailing list