my class Window_Map is the widget connect with mouse event and Slot my_clicked
void Window_Map::my_clicked(QMouseEvent &mouseEvent)
{
if(mouseEvent.button()==Qt::LeftButton){
auto mapPoint = _MapView->screenToLocation(mouseEvent.x(),mouseEvent.y());
qDebug()<<" Punto :: "<<mapPoint; // this show nan nan nan nan
}
else if(mouseEvent.button()==Qt::RightButton){
_C.setShape(Qt::ArrowCursor);
QGuiApplication::setOverrideCursor(_C);
disconnect(_MapView,SIGNAL(mouseClicked(QMouseEvent&)),this,SLOT(s1(QMouseEvent&)));
}
}
Solved! Go to Solution.
Hi Juan,
I think the problem here is that you are directly printing the Point to qDebug(). The problem is that we do not support this operater for the Point type - so you are actually printing invalid geometry details. If you want to see a string representation of the point you can do something like:
qDebug()<<" Punto :: "<<mapPoint.toJson();
I hope that makes helps.
Luke
Hi Juan,
I think the problem here is that you are directly printing the Point to qDebug(). The problem is that we do not support this operater for the Point type - so you are actually printing invalid geometry details. If you want to see a string representation of the point you can do something like:
qDebug()<<" Punto :: "<<mapPoint.toJson();
I hope that makes helps.
Luke
hello luke thank you very much for your help I hope to be able to share things also with you God bless you