Qt 6.11 is out! See what's new in the release
blog
qcustomplot: pixelsToCoords
-
Hi!
QVector<double> x; for(int i = 0; i < 128; i++){ x.push_back(i); } double scale = 2000; for(int i = -64; i < 64; i++){ x[i+64] = scale/128*i; } ui->graph->xAxis->setRange(-0.5*scale, 0.5*scale);I use mouse click event.
double px, py; ui->graph->graph(0)->pixelsToCoords(event->pos(), px, py);But I recieve 'px' in scaled values.
How to convert it to QVector data index? In my case value should be between 0 and 127.