QCustomPlot Discussion and Comments

Position QCPItemPixmapReturn to overview

Hi,

I have one QCPItemLine object and QCPItemPixmap object.

	y1 = 0;
	y2 = engine->getMainPlot()->yAxis->range().lower;
	x = engine->getMainPlot()->xAxis->range().upper*0.5;
        QPen linePen;
        linePen.setStyle(Qt::DashLine);
	linePen.setColor(Qt::white);
	linePen.setWidthF(0.3);
	line = new QCPItemLine(engine->getMainPlot());
	line->setLayer(engine->getMainPlot()->layer("lHUD"));
	line->setPen(linePen);
	line->start->setCoords(x, y1);
	line->end->setCoords(x, y2);
	line->setVisible(true)

	alignmentPixmap = new QCPItemPixmap(engine->getMainPlot());
	pixmap = QPixmap("alignment.png");
	alignmentPixmap->setPixmap(pixmap);
	alignmentPixmap->setLayer(engine->getMainPlot()->layer("topLayer"));
        alignmentPixmap->topLeft->setCoords(x, y1);

I need to place alignmentPixmap in a way that the center of alignmentPixmap is placed at the start of the line, but there are only options to set topLeft and bottom right coordinates. Does anyone have any idea how could I put the center of alignmentPixmap at the position x?

top = y-height/2, bottom = y+height/2
left = x-width/2, right = x+width/2.