[Qt-interest] Deleting a QGraphicsTextItem object in touch event handler crashes app

Bruce Cran bruce at cran.org.uk
Mon Mar 1 08:57:28 CET 2010


On Saturday 27 February 2010 07:32:46 Bruce Cran wrote:
> Hi,
> 
> I'm new to Qt so I'm not sure if what I'm trying to do should work or not.
>  I have a QGraphicsScene with a custom QGraphicsItem. When I move the mouse
>  over it, I want some text to be displayed somewhere else so I've
>  overridden the hover enter and hover leave events and added text to the
>  scene when entered and removed it when the mouse leaves my item.  However
>  I've found that when I delete the QGraphicsTextItem object (as opposed to
>  just removing it from the scene) I get a segfault in
>  QGraphicsItem::isPanel.  I'm wondering if I should be inheriting from
>  QGraphicsWidget and using signals/slots instead?
> 

Of course, the subject should read "in hover event handler", not "in touch 
event handler" - I got confused after reading QTBUG-6654.  It sounds like a 
similar issue, but I'm using QT 4.6.2.

-- 
Bruce Cran



More information about the Qt-interest-old mailing list