Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3
-
None
-
Win 7
Symbian^3
Qt 4.7.3
Qt pre 4.7.4 203b5edc04143edce0335c5e62de409c64df4c07
-
b9d5cb9334e7d9da71af169802a01f8d344151a7
Description
In certain circumstances setting ListView's highlight property to null can cause a segmentation fault. The attached application can be used to reproduce the issue. See also the attached callstack.txt.
In the application the highlight property is set to null when active focus is lost. Because of this there's a problem in QGraphicsItemPrivate::setVisibleHelper in this loop:
// Update children with explicitly = false. const bool updateChildren = update && !(flags & QGraphicsItem::ItemClipsChildrenToShape); foreach (QGraphicsItem *child, children) { if (!newVisible || !child->d_ptr->explicitlyHidden) child->d_ptr->setVisibleHelper(newVisible, false, updateChildren); }
It seems the iterated QList is modified and deep copied during the loop due to a child getting deleted. After this the QList copy contains a null pointer which causes the fault.