tblWidget->installEventFilter(this);
...
bool eventFilter(QObject *obj, QEvent *event)
{
if (obj == tblWidget&& event == QEvent::MouseButtonPress)
{
QMouseEvent *mouseEvent = static_cast(event);
if (!tblWidget->itemAt(mouseEvent->pos())) {
...
}
}
// standard event processing
return QObject::eventFilter(obj, event);
}