Results 1 to 2 of 2

Thread: How to separate mouse and tablet event in QGraphicsView/Scene ?

  1. #1
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    9
    Qt products
    Qt4

    Default How to separate mouse and tablet event in QGraphicsView/Scene ?

    Hi experts,

    I want to draw by TabletEvent and drag objects by MouseEvent.

    I have overwritten both tablet and mouse events in QGraphicsView.

    The problem is, even I only use the tablet, mouse events are also invoked. (not always )

    So I can not draw by TABLET and drag by MOUSE.

    Is it possible to specify two events in the QGraphicsView ?

    If you know that, can you give me some suggestion.

    I confuse the problem in a long time

    Thank your help

  2. #2
    Join Date
    Aug 2011
    Posts
    19
    Thanks
    9
    Qt products
    Qt4

    Default Re: How to separate mouse and tablet event in QGraphicsView/Scene ?

    I review the document, Qt 4.7: QTabletEvent Class
    http://harmattan-dev.nokia.com/docs/...bletevent.html

    ....
    The event handler QWidget::tabletEvent() receives all three types of tablet events. Qt will first send a tabletEvent then, if it is not accepted, it will send a mouse event. This allows applications that don't utilize tablets to use a tablet like a mouse, while also enabling those who want to use both tablets and mouses differently.



    So I accept every event in tabletEvent(). The mouse events still happen while I use tablet.

    What's wrong about it ?

    Qt Code:
    1. void TabletCanvas::tabletEvent(QTabletEvent *event)
    2. {
    3. event->setAccepted(true);
    4. ..
    5. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 1
    Last Post: 5th December 2012, 10:03
  2. Ogre+qt mouse event (add object with mouse problem)
    By rimie23 in forum Qt Programming
    Replies: 7
    Last Post: 24th April 2012, 10:49
  3. Replies: 3
    Last Post: 7th January 2012, 08:38
  4. Replies: 1
    Last Post: 3rd August 2011, 01:14
  5. QGraphicsview and mouse press event
    By eva2002 in forum Qt Programming
    Replies: 6
    Last Post: 26th January 2010, 05:04

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.