[Qt-interest] How to handle the event filter in Qt graphicsview

Anders Bakken anders.bakken at myriadgroup.com
Fri Jul 23 00:04:19 CEST 2010


On Thu, Jul 22, 2010 at 04:21:02PM +0100, Ross Bencina wrote:
> Hi Ramesh
>
> From memory the elastic nodes example has some keyboard event
> handling. Perhaps look at that.
>
> I think the easiest thing would be to override the standard keyboard
> event handlers in a QGraphicsVIew subclass.
>
> Ross.

There's a ton of ways to do it really. You could implement the event
handlers in each item, in the scene, in the view or using an
eventfilter on either the view or the scene.

Most times I'd say it's cleaner to not use an eventfilter and most times
I'd recommend using the event handlers in the items or in the scene
simply because that's likely to be closer to the logic of your app
than the view but these are just my preferences.

--
Anders Bakken

This message, including attachments, is intended solely for the addressee indicated in this message and is strictly confidential or otherwise privileged. If you are not the intended recipient (or responsible for delivery of the message to such person) : - (1) please immediately (i) notify the sender by reply email and (ii) delete this message and attachments, - (2) any use, copy or dissemination of this transmission is strictly prohibited. If you or your employer does not consent to Internet email messages of this kind, please advise Myriad Group AG by reply e-mail immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by Myriad Group AG unless otherwise indicated by an authorized representative independent of this message.




More information about the Qt-interest-old mailing list