RPolylineEntity cann't be selected? why?

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
liguosheng
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...

why?

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
andrew
Site Admin
Posts: 9037
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 Programming, Script Programming and Contributing”