View Full Version : How to separate mouse and tablet event in QGraphicsView/Scene ?

29th April 2013, 17:21
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 :confused:)

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 :crying:

Thank your help

30th April 2013, 11:41
I review the document, Qt 4.7: QTabletEvent Class

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 ?

void TabletCanvas::tabletEvent(QTabletEvent *event)