Hi everyone,
I need to put a cursor that indicate the 0 of the graph. This cursor should be tied with the axis of the specific graph.
I tried QPixmapItem and it seems to work, but the pixmap will be placed into the graph and if I scroll (vertically or horizontally) the graph, pixmap is tied with the plot area (AxisRect).
This is my code (into MainWindow constructor):
QPixmap p; p.load("://resources/pixmap/cursor0.png"); zeroCursor = new QCPItemPixmap(ui->Plot); zeroCursor->setPixmap(p); zeroCursor->setClipAxisRect(ui->Plot->axisRect(0)->axis(QCPAxis::atLeft,2)->axisRect()); zeroCursor->setClipToAxisRect(false); zeroCursor->topLeft->setCoords(0,0);
On the contrary, I would like a pixmap fixed with the vertical axis, something like this: https://postimg.org/image/3t2klt4lr/
Moreover, according to some forum post, I tried to add a new layer too, but it didn't work: this error occurs "bool QCustomPlot::addLayer(const QString&, QCPLayer*, QCustomPlot::LayerInsertMode) otherLayer not a layer of this QCustomPlot
"
What is the best way to do add a cursor on y-axis bound with each waveform?
Thanks
Calzo
v2.0.0.beta, QT 5.7