[Qt-interest] QGraphicsScene:Items returning invisible items

Girish Ramakrishnan girish at forwardbias.in
Thu Oct 15 14:23:56 CEST 2009


James Vernon wrote:
> Hi all,
> I have a QGraphicsScene containing some visible items and some
> invisible items. I want to do a collision detection at particular
> points which I tried to do with the QGraphicsScene::items(), but
> items() is only intended to return visible items. I think it used to
> be possible to make items "visible" but give them an opacity of 0 so
> the user couldn't see tem in the scene view as a way to get around
> this, but I just tried it in Qt 4.6 beta and this work around seems to
> have been optimised away. Is there a better method to find all items
> at a point in a scene including items with visible set to false?

It seems like a bug that items with opacity 0 are optimized away. An
item that does not paint anything != invisible item.

Girish



More information about the Qt-interest-old mailing list