Fix reported location when double clicking a graph. Now reported X,Y

location matches where the circle indicator is actually placed.
This commit is contained in:
Collin Kidder
2019-05-06 21:49:10 -04:00
parent c6cba08f2e
commit 539fecc16b
+5 -1
View File
@@ -245,11 +245,15 @@ void GraphingWindow::plottableDoubleClick(QCPAbstractPlottable* plottable, int d
double x, y;
QCPGraph *graph = reinterpret_cast<QCPGraph *>(plottable);
graph->pixelsToCoords(event->localPos(), x, y);
locationText->setText("X: " + QString::number(x) + " Y: " + QString::number(y));
x = ui->graphingView->xAxis->pixelToCoord(event->localPos().x());
itemTracer->setGraph(graph);
itemTracer->setVisible(true);
itemTracer->setInterpolating(true);
itemTracer->setGraphKey(x);
itemTracer->updatePosition();
qDebug() << "val " << itemTracer->position->value();
locationText->setText("X: " + QString::number(x) + " Y: " + QString::number(itemTracer->position->value()));
}
void GraphingWindow::gotCenterTimeID(int32_t ID, double timestamp)