
If (board & board->viewport() = lastChild) QWidget *lastChild = widgetForTabletEvent(childWidget, pos) If (childWidget->isVisible() & childWidget->geometry().contains(pos)) QWidget *childWidget = qobject_cast(child) QWidget *UBBoardView::widgetForTabletEvent(QWidget *w, const QPoint &pos) If (NULL = widgetForTabletEvent(this->parentWidget(), tEvent->pos()))Īlso i need to stop handle tablet events for QGraphicsView childs. QTabletEvent *tEvent = static_cast(event) The problem is: i need to use tablet for any controls in application, so i need to determine when QGraphicsView is under mouse cursor: bool UBBoardView::directTabletEvent(QEvent *event) Return controlV->directTabletEvent(event) UBBoardView *controlV = UBApplication::boardController->controlView() If (NULL != UBApplication::boardController) So i reimplemented that method and parsed tablet event there: bool UBMainWindow::event(QEvent *event) I didn't found where is the problem, but i found that QMainWindow returns false from ::event() method. It sends event to NSWindow (QMainWindow) instead of NSView (QGraphicsView). I spent more time on comparison Qt 4.8.0 and 4.7.3 and now i see that it is the problem in internal qt event dispatcher. Then seems it is QWidget *qwidget = works wrong. So tablet event doesn't comes to QMainWindow childs. Since QMainWindow have no Parent, it is all. Default implementation is event->ignore(). It calls event processing by filters, layouts and then - QMainWindow::tabletEvent. || w->testAttribute(Qt::WA_NoMousePropagation))Īs we can see: res = d->notify_helper(w, w = receiver ? tablet : &te) Res = d->notify_helper(w, w = receiver ? tablet : &te) ĮventAccepted = ((w = receiver) ? tablet : &te)->isAccepted() Tablet->modifiers(), tablet->uniqueId()) Tablet->tangentialPressure(), tablet->rotation(), tablet->z(), Tablet->pressure(), tablet->xTilt(), tablet->yTilt(), Tablet->hiResGlobalPos(), tablet->device(), tablet->pointerType(), QTabletEvent te(tablet->type(), relpos, tablet->globalPos(), Then inside QApplication::notify(): QWidget *w = static_cast(receiver) īool eventAccepted = tablet->isAccepted() QtabletEvent - is not accepted event created just before calling sendSpontaneousEvent.

I see that inside qt_mac_handleTabletEvent: QWidget *qwidget = Īnd then: `qt_sendSpontaneousEvent(widgetToGetMouse, &qtabletEvent) ` The 1st receiver of tablet event is QMainWindow. If i set parent to 0, tablet events delivers fine. They comes to QMainWindow as mouseEvents. They comes to QApplication::eventFilter fine, but doesn't comes to view. QMainWindow->centralWidget->ControlContainerWidget->QStackedLayout->QGraphicsView I handle QTabletEvents and it works only for QGrahicsView instance that doesn't have parent (means parent=0).

I'm using tablet (wacom pen and touch) for painting. The same types, but one view have a parent, and the another - doesn't (also it's transparent, used for drawing something over desktop). I have two instances of QGraphcisScene and two instances of QGraphicsView.
#Wacom tablet mac os 10.7 windows
Works fine in Qt 4.7.3 on any OS and Qt 4.8.0 on Windows and Linux.
