[Qt-interest] Use different cursor when different modifier key is pressed

Stephen Chu stephen at ju-ju.com
Tue Nov 10 15:48:18 CET 2009


In article 
<214b3fc60911092103t5980b38cw2759f96c82e29807 at mail.gmail.com>,
 Abhishek <abhishekworld at gmail.com> wrote:
> if you look at Doc
> http://doc.trolltech.com/4.5/qgraphicsitem.html#keyPressEvent
> 
> it says *Note that key events are only received for items that set the
> ItemIsFocusable<http://doc.trolltech.com/4.5/qgraphicsitem.html#GraphicsItemFl
> ag-enum>flag,
> and that have keyboard input focus.
> *

Thanks. I tried that. It works only after the user clicks at the item. 
I'd like to skip the click part.

In article <hdb270$ah0$1 at eple.troll.no>,
 André Somers <andre at familiesomers.nl> wrote:

> That means, that your QGraphicsItem will not receive the keypresses. You may
> be able to fix that by making your item derive from QObject (as well as
> QGraphicsItem) and then using the event filter mechanism to listen in on the
> key events being send around.

Yes. I think that's the way to go. But which object should I install the 
event filter to?

-- 
Stephen Chu



More information about the Qt-interest-old mailing list