I share a partial code:
QObject::connect(&customPlot, &QCustomPlot::mouseWheel, [&](QWheelEvent *event) {
ControlRange(customPlot);
});
ControlRange verify if the zoom in or out is inside from the original ranges, if not I adjust them.
But When I try to apply them using this commands
customPlot.xAxis->setRange(xNewRange);
customPlot.yAxis->setRange(yNewRange);
QcustomPlot is not applying my newRanges is applying something else. So is posible to do it?