You need to localize the knowledge within the Mainwindow, and post the event to it.
So:
Post the event to the Mainwindow instance.
Reimplement
MainWindow::customEvent(...)
as follows (if it's a custom QEvent, otherwise you'd reimplementevent(...)
:void MainWindow::customEvent(QEvent * ev) { if (ev->type() == MyEventType) { QCoreApplication::sendEvent(ui->treeView, ev); } }
Alas, why on Earth would you need to send an event to a view?