How to use QwtEventPattern correctly?
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:
Code:
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.
Code:
#if QT_VERSION < 0x040000
Qt::RightButton, Qt::ControlButton);
#else
Qt::RightButton, Qt::ControlModifier);
#endif
Qt::RightButton);
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
Re: How to use QwtEventPattern correctly?
Depending on the selection type the patterns are used differently. In your case the following code assigns all user interactions (zoom in, zoom out 1 and unzoom (0) to the right mouse button.
Code:
zoomer
->setMousePattern
(QwtEventPattern::MouseSelect2, Qt
::RightButton, Qt
::ControlModifier);
zoomer
->setMousePattern
(QwtEventPattern::MouseSelect3, Qt
::RightButton, Qt
::ShiftModifier);
Uwe
Re: How to use QwtEventPattern correctly?
Thank you, Uwe.
Meanwhile, I have separated the PlotPicker and Zoomer interactions by a Toolbutton which enables or disables the on of the QwtPickers.
But probably I will test your suggestion, to make the interaction faster.
regards
MouseSelect1,Qt::RightButton
picker->setMousePattern(QwtEventPattern::MouseSelect1,Qt: :RightButton); // crashes reason i installed UFT 12.53 automation testing tool and added QT Add-in while installing UFT
please suggest me
Re: MouseSelect1,Qt::RightButton
I don't know the UFT test tool and I have no idea what it does. So I'm afraid you have to use your debugger to find out what part of the application crashes - maybe coming back with a call stack.
At least you have to feed me with more information, than posting a line of your code.
Uwe
PS: please start a new thread instead of continuing to another almost unrelated one.