paramview: discard scroll events on widgets

This commit is contained in:
itsmattkc
2020-11-23 12:01:21 +11:00
parent ade4369199
commit 2c4f781e13
2 changed files with 26 additions and 0 deletions
@@ -188,6 +188,11 @@ void NodeParamViewWidgetBridge::CreateWidgets()
UpdateWidgetValues();
// Install event filter to disable widgets picking up scroll events
foreach (QWidget* w, widgets_) {
w->installEventFilter(&scroll_filter_);
}
}
}
@@ -694,4 +699,16 @@ void NodeParamViewWidgetBridge::PropertyChanged(const QString &key, const QVaria
}
}
bool NodeParamViewScrollBlocker::eventFilter(QObject *watched, QEvent *event)
{
Q_UNUSED(watched)
if (event->type() == QEvent::Wheel) {
// Block this event
return true;
}
return false;
}
}
@@ -30,6 +30,13 @@
namespace olive {
class NodeParamViewScrollBlocker : public QObject
{
Q_OBJECT
public:
virtual bool eventFilter(QObject* watched, QEvent* event) override;
};
class NodeParamViewWidgetBridge : public QObject, public TimeTargetObject
{
Q_OBJECT
@@ -63,6 +70,8 @@ private:
NodeInputDragger dragger_;
NodeParamViewScrollBlocker scroll_filter_;
private slots:
void WidgetCallback();