what is the correct way to use QCPItemLine with layers? i have a pixamp which i draw on the grid with QCustomPlot and i want to draw a line above the pixmap, so far it is being shown below the pixmap.
lets say i already set a pixmap how can i be sure where the line will be shown? according to documentaions the way to draw a line is:
QCOItemLine* line = new QCOItemLine(ui->grid);
_line->start->setCoords(x_tail, y_tail);
_line->end->setCoords(x_head, y_head);
ui->widget->replot();
unlike points the line dosent related to specific graph or layer so how do i manage it?
this is how i set the pixmap:
QCPItemPixamp* _pixmap;
Qimage image;
getImageData(image);
ui->grid->addLayer("map", ui->grid->layer("main));
QPixmap pixels = QPixmap::fromImage(image.scaled(ui->grid->width(),
ui->grid->height(), Qt::IgnoreAspectRatio, Qt::FastTransformation));
_pixmap->setVisible(true);
_pixmap->setScaled(true);
_pixmap->setPixmap(pixels);
_pixmap->topLeft->setCoords(left_x, bottom_y);
_pixmap->bottomRight->setCoords(right_x, top_y);
i want to draw a line above this pixmap