Results 1 to 2 of 2

Thread: Tablet Events in QGraphicsItem

  1. #1
    Join Date
    Mar 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Tablet Events in QGraphicsItem

    Hi,

    I have recently switched to the Graphics View framework in my painting application. Everything works fine, except for the fact that I can't find a way to capture events from my (wacom) tablet. Of course QWidget had tabletEvent, but what does QGraphicsItem offer for that purpose?
    The only mention of the word "tablet" i could find in the class documentation is in QGraphicsItem::ItemClipsToShape flag's description:
    The item cannot draw or receive mouse, tablet, drag and drop or hover events outside its shape.
    but nothing more.
    I'm sure there is a way around this so I don't have to return to QWidget + QGraphicsProxyWidget

    Thanks
    Last edited by Soapbubble; 14th May 2011 at 15:24.

  2. #2
    Join Date
    Mar 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Tablet Events in QGraphicsItem

    Actually I have tried to go for embedding the painting widget into a QGraphicsProxyWidget, but tablet events are still not recognized. I suppose QGraphicsProxyWidget doesn't forwards them to the QWidget object, despite the documentation that claims
    Through QGraphicsProxyWidget, Graphics View is able to deeply integrate the client widget features including its cursors, tooltips, mouse, tablet and keyboard events
    Now I really am confused.
    Any help please
    Thank you!


    Added after 1 29 minutes:


    OK, so after further research, it seems that, if I stick with the graphics view framework, I have to manually capture all the events that the QGraphicsView viewport recieves and somehow determine which one is generated by the tablet. Afterwards, I should translate this event into a custom subclass of QGraphicsSceneEvent while leaving any other scene event intact. Finally, the QGraphicsProxyWidget or QGraphicsItem item in my scene should be able to receive my custom event and process it.

    Again, this approach is new to me so I'm not sure it would work.
    So, as a summary to my 3 posts, what answer do I deserve?
    Last edited by Soapbubble; 15th May 2011 at 09:01.

Similar Threads

  1. mouse events handling with QGraphicsItem
    By trallallero in forum Qt Programming
    Replies: 3
    Last Post: 21st October 2009, 14:15
  2. QGraphicsItem reimplemented mouse events
    By aarelovich in forum Qt Programming
    Replies: 12
    Last Post: 24th July 2009, 12:56
  3. tablet events broken in X
    By aalexei in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2009, 13:15
  4. QGraphicsItem mouse events
    By zgulser in forum Qt Programming
    Replies: 13
    Last Post: 11th February 2009, 11:19
  5. QGraphicsItem hover events
    By stefan in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2008, 11:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.