eventFilter监控鼠标动作,请教
bool Vrf_home::eventFilter(QObject *obj, QEvent *ev){ if (obj==home_ui.monitor) { if (ev->type()==QEvent::MouseButtonRelease) { home_ui.monitor->setGeometry(QRect(55, 123, 106, 106)); home_ui.monitor->setStyleSheet(QString::fromUtf8("border-image: url(:/test_memory/Resources/monitor.png);")); return true; } if (ev->type()==QEvent::MouseButtonPress) { home_ui.monitor->setGeometry(QRect(55-14, 123-14, 106+28, 106+28)); home_ui.monitor->setStyleSheet(QString::fromUtf8("border-image: url(:/test_memory/Resources/monitor_light.png);")); return true; } } return QWidget::eventFilter(obj, ev);}