hi Santosh,
This is what i tried earlier
inside mouseMoveEvent
for(int i =1; i < theResvPath.elementCount(); i++)
{
QPointF repPath
= theResvPath.
elementAt(i
);
QRectF sampRect
= QRectF(e
->pos
().
x() , e
->pos
().
y() ,
1,
1 );
bool intersects = theResvPath.intersects(sampRect);
qDebug()<<"The painter path:"<<repPath<<"and the rect:"<<sampRect<<"and the intersects:"<<intersects;
if(intersects){
}
theResvPath.lineTo(e->pos());
}
for(int i =1; i < theResvPath.elementCount(); i++)
{
QPointF repPath = theResvPath.elementAt(i);
QRectF sampRect = QRectF(e->pos().x() , e->pos().y() ,1, 1 );
bool intersects = theResvPath.intersects(sampRect);
qDebug()<<"The painter path:"<<repPath<<"and the rect:"<<sampRect<<"and the intersects:"<<intersects;
if(intersects){
}
theResvPath.lineTo(e->pos());
}
To copy to clipboard, switch view to plain text mode
but the intersects return true even one x,y is inside the path
The painter path: QPointF(982.268, 337.732) and the rect: QRectF(917.938,609.897 1x1) and the intersects: true .
Bookmarks