PDA

View Full Version : QPolygon contains point working extremely slow.



sergey_m
8th December 2011, 07:45
Hi,

I'm trying to implement sort of Photoshop lasso tool (region selection).

I have QGraphicsScene. On scene I have QGraphicsPolygonItem. When I selected some region and have polygon describing this region I'm trying to check if polygon contains point where I clicked with mouse. For this I'm calling selectedPolygon.containsPoint(QPoint(i,j), Qt::WindingFill), but it's working extremely slow, especially if my polygon has complex form... it can be 5-20 seconds to check all points.

Does anybody had such problem, maybe some ideas or solutions?

TIA

Sergey