bool VideoWidget::eventFilter(QObject* obj, QEvent* ev){ if (ev->type() == QEvent::MouseMove && obj == mVideoWidget) { qDebug() << "filter"; mouseMoveEvent(static_cast<QMouseEvent*>(ev)); ev->accept(); return true; } else { return QWidget::eventFilter(obj, ev); }}
mVideoWidget->installEventFilter(this);
C++ (Qt)bool MyApp::notify( QObject * receiver, QEvent * e ){ static int theNum = 0; switch (e->type()) { case QEvent::Timer: // этого не печатать break; default: qDebug() << ++theNum << receiver << e->type(); } return QApplication::notify(receiver, e);}
1470 QWidgetWindow(0xa37020, name = "QVideoWidgetClassWindow") 5 1471 QVideoWidget(0xa2fc28) 5 1472 QWidgetWindow(0xa37020, name = "QVideoWidgetClassWindow") 5 1473 QVideoWidget(0xa2fc28) 5 1474 QWidgetWindow(0xa37020, name = "QVideoWidgetClassWindow") 5 1475 QVideoWidget(0xa2fc28) 5 1476 QWidgetWindow(0xa37020, name = "QVideoWidgetClassWindow") 5 1477 QVideoWidget(0xa2fc28) 5 1478 QWidgetWindow(0xa37020, name = "QVideoWidgetClassWindow") 5 1479 QVideoWidget(0xa2fc28) 5 1480 QWidgetWindow(0xa37020, name = "QVideoWidgetClassWindow") 5 1481 QVideoWidget(0xa2fc28) 5 1482 QWidgetWindow(0xa37020, name = "QVideoWidgetClassWindow") 5
9587 QWidgetWindow(0xe425e0, name = "MainWidgetClassWindow") 59588 MainWidget(0x9520b0) 59589 QXcbConnection(0x7676b0) 439590 QWidgetWindow(0xe425e0, name = "MainWidgetClassWindow") 59591 MainWidget(0x9520b0) 59592 QXcbConnection(0x7676b0) 439593 QWidgetWindow(0xe425e0, name = "MainWidgetClassWindow") 59594 MainWidget(0x9520b0) 59595 QXcbConnection(0x7676b0) 439596 QWidgetWindow(0xe425e0, name = "MainWidgetClassWindow") 59597 MainWidget(0x9520b0) 59598 QXcbConnection(0x7676b0) 439599 QWidgetWindow(0xe425e0, name = "MainWidgetClassWindow") 59600 MainWidget(0x9520b0) 59601 QXcbConnection(0x7676b0) 43
void QWindow::setTransientParent(QWindow*) QWidgetWindow(0xf7a7a0, name = "VideoFormWindow") must be a top level window.