void setupWidget(ItemInfo info, EffectMetaInfo *metaInfo);
void updateTimecodeFormat();
void setActive(bool activate);
+ /** @brief Install event filter so that scrolling with mouse wheel does not change parameter value. */
virtual bool eventFilter( QObject * o, QEvent * e );
/** @brief Update effect GUI to reflect parameted changes. */
void updateWidget(ItemInfo info, QDomElement effect, EffectMetaInfo *metaInfo);
#include <QPushButton>
#include <QCheckBox>
#include <QScrollArea>
+#include <QScrollBar>
+#include <QProgressBar>
// For QDomNode debugging (output into files); leaving here as sample code.
//#define DEBUG_ESE
}
}
+bool EffectStackEdit::eventFilter( QObject * o, QEvent * e )
+{
+ if (e->type() == QEvent::Wheel) {
+ QWheelEvent *we = static_cast<QWheelEvent *>(e);
+ bool filterWheel = verticalScrollBar() && verticalScrollBar()->isVisible();
+ if (!filterWheel || we->modifiers() != Qt::NoModifier) {
+ e->accept();
+ return false;
+ }
+ if (qobject_cast<QAbstractSpinBox*>(o)) {
+ if(qobject_cast<QAbstractSpinBox*>(o)->focusPolicy() == Qt::WheelFocus)
+ {
+ e->accept();
+ return false;
+ }
+ else
+ {
+ e->ignore();
+ return true;
+ }
+ }
+ if (qobject_cast<KComboBox*>(o)) {
+ if(qobject_cast<KComboBox*>(o)->focusPolicy() == Qt::WheelFocus)
+ {
+ e->accept();
+ return false;
+ }
+ else
+ {
+ e->ignore();
+ return true;
+ }
+ }
+ if (qobject_cast<QProgressBar*>(o)) {
+ if(qobject_cast<QProgressBar*>(o)->focusPolicy() == Qt::WheelFocus)
+ {
+ e->accept();
+ return false;
+ }
+ else
+ {
+ e->ignore();
+ return true;
+ }
+ }
+ }
+ return QWidget::eventFilter(o, e);
+}
+
void EffectStackEdit::transferParamDesc(const QDomElement &d, ItemInfo info, bool /*isEffect*/)
{
if (m_paramWidget) delete m_paramWidget;
connect (this, SIGNAL(syncEffectsPos(int)), m_paramWidget, SIGNAL(syncEffectsPos(int)));
connect (m_paramWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
connect (m_paramWidget, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
+
+
+ Q_FOREACH( QSpinBox * sp, m_baseWidget->findChildren<QSpinBox*>() ) {
+ sp->installEventFilter( this );
+ sp->setFocusPolicy( Qt::StrongFocus );
+ }
+ Q_FOREACH( KComboBox * cb, m_baseWidget->findChildren<KComboBox*>() ) {
+ cb->installEventFilter( this );
+ cb->setFocusPolicy( Qt::StrongFocus );
+ }
+ Q_FOREACH( QProgressBar * cb, m_baseWidget->findChildren<QProgressBar*>() ) {
+ cb->installEventFilter( this );
+ cb->setFocusPolicy( Qt::StrongFocus );
+ }
+
return;
/*
//clearAllItems();