rambo83
23rd November 2009, 08:07
Hello,
I just wanted to change the behaviour of my Zoomer, so that the zoom in effect is not affected from the Leftbutton, but from the Rightbutton, thus I could use LeftButton for selection in QwtPlotPicker.
Unfortunately, I don't understand what the statement means:
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
QwtEventPattern::MouseSelect2 means already that the Rightbutton will be used, why then the second parameter Qt::RightButton? How can I change zoom function from LeftButton to Rightbutton? I use the zoomer from spectrogram example.
QwtPlotZoomer* zoomer = new MyZoomer(canvas());
#if QT_VERSION < 0x040000
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlButton);
#else
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
#endif
zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
Qt::RightButton);
QwtPlotPanner *panner = new QwtPlotPanner(canvas());
panner->setAxisEnabled(QwtPlot::yRight, false);
panner->setMouseButton(Qt::MidButton);
For the panning function it is straightforward, that the MidButton will take over this action, but for zoom in and zoom out, it is not clear for me. Please explain it to me.
Thank you.
best regards
I just wanted to change the behaviour of my Zoomer, so that the zoom in effect is not affected from the Leftbutton, but from the Rightbutton, thus I could use LeftButton for selection in QwtPlotPicker.
Unfortunately, I don't understand what the statement means:
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
QwtEventPattern::MouseSelect2 means already that the Rightbutton will be used, why then the second parameter Qt::RightButton? How can I change zoom function from LeftButton to Rightbutton? I use the zoomer from spectrogram example.
QwtPlotZoomer* zoomer = new MyZoomer(canvas());
#if QT_VERSION < 0x040000
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlButton);
#else
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
#endif
zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
Qt::RightButton);
QwtPlotPanner *panner = new QwtPlotPanner(canvas());
panner->setAxisEnabled(QwtPlot::yRight, false);
panner->setMouseButton(Qt::MidButton);
For the panning function it is straightforward, that the MidButton will take over this action, but for zoom in and zoom out, it is not clear for me. Please explain it to me.
Thank you.
best regards