Hello everyone,
I have hours to find a solution without success, so I post my problem here.
I have created a QCPItemText around my xaxis2 and I want to be able to drag it (at least horizontally)
QCPAxis *yAxis4 = m_CustomPlot->axisRect()->addAxis(QCPAxis::atLeft); yAxis4->setRange(-10,0); yAxis4->setVisible(false); // Marqueur Texte: QCPItemText *textLabel = new QCPItemText(m_CustomPlot); textLabel->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter); textLabel->setSelectable(true); textLabel->position->setAxes(m_CustomPlot->xAxis2, yAxis4); textLabel->position->setType(QCPItemPosition::ptPlotCoords); textLabel->setClipToAxisRect(false); textLabel->position->setCoords(10, 0.5); textLabel->setText("my_text"); textLabel->setPen(Qt::NoPen);
Does anyone has an idea to drag this textLabel ? thanks in advance for any support
Regards