connect(ui->customPlot, SIGNAL(mousePress(QMouseEvent*)), SLOT(mousepress(QMouseEvent*)));

void MainWindow::mousepress(QMouseEvent* event)
{
   QPoint point = event->pos();

   qDebug()<<ui->customPlot->xAxis->pixelToCoord(point.x());


}