bool Widget::installFilter(QObject *obj) // 安装事件过滤
{
obj->installEventFilter(this);
QObjectList children = obj->children();
for (int i = 0; i < children.size(); i++)
{
installFilter(children.at(i));
}
return false;
}
release 下
debug
解决办法 加上 return QWidget::eventFilter(obj, event);
bool Widget::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::MouseButtonPress)
{
}
return QWidget::eventFilter(obj, event);
}
再次运行