RPolylineEntity cann't be selected? why?

Discussion forum for contributors and developers who are using the QCAD ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Post Reply
Active Member
Posts: 33
Joined: Thu Jan 14, 2016 4:17 am

RPolylineEntity cann't be selected? why?

Post by liguosheng » Tue Apr 26, 2016 3:33 am

in the function of mouseMoveEvent(QMouseEvent* event),RPolylineEntity cann't be selected by the following code:
RMouseEvent e(*event, *scene, *this, getDevicePixelRatio());
RDocumentInterface *di = getDocumentInterface();
REntity::Id entityId = di->getClosestEntity(e);

entityId is null, but other entity can be selected, e.g. RLineEntity, REllipseEntity, RSplineEntity...


when i debug it step by step, the return value of the following funciton is null:
QSet<REntity::Id> RDocument::queryInfiniteEntities() {
return storage.queryInfiniteEntities();

User avatar
Site Admin
Posts: 6903
Joined: Fri Mar 30, 2007 6:07 am

Re: RPolylineEntity cann't be selected? why?

Post by andrew » Tue Apr 26, 2016 12:25 pm

getClosestEntity should work for all entities.

queryInfiniteEntities only returns IDs for infinite entities (XLines, Rays).

Perhaps you can attach the drawing with the polyline in question.

Post Reply

Return to “QCAD Developers and Contributors”