QCustomPlot Discussion and Comments

Attach a QCPItemText to a QCPItemTracerReturn to overview

I have a QCPItemTracer and I want a QCPItemText to stick to it.

// make tracer
QCPItemTracer *phaseTracer = new QCPItemTracer(ui->cPlot);

// add the text label
QCPItemText *textLabel = new QCPItemText(ui->cPlot);
textLabel->setText("Text Item Demo");

How can I have the QCPItemText stick to the tracer? So that when I drag on the plot, it stays in place. I am able to set coordinates for textLabel but even that never appears correct.

help plx



Thanks wincak, it works now!