paramview: discard scroll events on widgets
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user