通过继承重写QCustomPlot
void wheelEvent(QWheelEvent* event) override {
// 将滚轮事件传递给父窗体
QWidget* parentWidget = qobject_cast<QWidget*>(parent());
if (parentWidget) {
QCoreApplication::sendEvent(parentWidget, event);
}
}
12-28
1592
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交