Quote Originally Posted by kecsap View Post
Ok, I did not take into account this composite widget stuff. So what is my expectation:
- There is a QwtPlot widget without focus ( or other events ) and if I click inside or outside the canvas area (e.g the axis area) with the left mouse button, I can grab a FocusIn event on the QwtPlot widget and the keyboard shortcuts work with the e.g QwtPlotZoomer..
It works like this: when a widget doesn't accept the focus it is propagated to its parent. This is how Qt works - nothing special for Qwt.

The default setting is that canvas and legend items ( depending on the mode ) accept the focus the other widgets don't. You could modify this - f.e. by setting Qt::NoFocus as focus policy for the canvas and then the plot widget will get FocusIn/Out events when you click on the canvas too, but this will break the zoomer, that handles key events on the canvas ( modifying them is probably what you really want to do ).

Instead do "plot->setFocusProxy( plot->canvas() );" when you also want to have the focus on the canvas, when you click on the scales.

Uwe