I have some trouble trying to interact with a QCPItemLine. Basically is a cursor for the plot.
I have created it with the following lines
vCursor = new QCPItemLine(ui->qplot); ui->qplot->addItem(vCursor); vCursor->setPen(QPen(Qt::black)); vCursor->setSelectedPen(QPen(Qt::red)); vCursor->start->setCoords( 0, QCPRange::minRange); vCursor->end->setCoords( 0, QCPRange::maxRange);
I enabled the interaction with
And connected the signal
connect(ui->qplot, SIGNAL(selectionChangedByUser()), this, SLOT(select()));
But the select() slot is not reached when I click on the line.
I tested also the
connect(vCursor, SIGNAL(selectableChanged(bool)), this, SLOT(select(bool))); connect(vCursor, SIGNAL(selectionChanged(bool)), this, SLOT(select(bool)));
But again slot is not reached.
If I select the item by code
The cursor become selected (red) and the slot executed.
Thanks in advance for any suggestion ^_^