My problem is very interesting to me. I am working on Qwt and I would like to enable zoom respect X and Y axis separately. I achived zoom only X axis but Y axis didn't work. I couldn't get it. I will be glad if you give an advise.
Here is my code:
{
if(event->key() == Qt::Key_Shift)
{
zoom_in_out->setWheelModifiers(Qt::ShiftModifier);
zoom_in_out->setAxisEnabled(Qt::XAxis,false);
}
else if(event->key() == Qt::Key_Control)
{
zoom_in_out->setWheelModifiers(Qt::ControlModifier);
zoom_in_out->setAxisEnabled(Qt::YAxis,false);
}
}
void Kmh::keyPressEvent(QKeyEvent *event)
{
zoom_in_out = new QwtPlotMagnifier( canvas() );
if(event->key() == Qt::Key_Shift)
{
zoom_in_out->setWheelModifiers(Qt::ShiftModifier);
zoom_in_out->setAxisEnabled(Qt::XAxis,false);
}
else if(event->key() == Qt::Key_Control)
{
zoom_in_out->setWheelModifiers(Qt::ControlModifier);
zoom_in_out->setAxisEnabled(Qt::YAxis,false);
}
}
To copy to clipboard, switch view to plain text mode
shift + mousewheel is working for zoom respect X axis. But ctrl + mousewheel is zooming both X and Y axis. What am I doing wrong?
Regards
Bookmarks