diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 43bec0e3e9..4410308d7e 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -59,9 +59,10 @@ wxQtWidget::wxQtWidget( wxWindowQt *parent, wxWindowQt *handler ) class wxQtScrollArea : public wxQtEventSignalHandler< QScrollArea, wxWindowQt > { +public: + wxQtScrollArea(wxWindowQt *parent, wxWindowQt *handler); - public: - wxQtScrollArea( wxWindowQt *parent, wxWindowQt *handler ); + bool event(QEvent *e) wxOVERRIDE; }; wxQtScrollArea::wxQtScrollArea( wxWindowQt *parent, wxWindowQt *handler ) @@ -69,6 +70,27 @@ wxQtScrollArea::wxQtScrollArea( wxWindowQt *parent, wxWindowQt *handler ) { } +bool wxQtScrollArea::event(QEvent *e) +{ + wxWindowQt* handler = GetHandler(); + if ( handler && handler->HasCapture() ) + { + switch ( e->type() ) + { + case QEvent::MouseButtonRelease: + case QEvent::MouseButtonDblClick: + case QEvent::MouseMove: + case QEvent::Wheel: + case QEvent::TouchUpdate: + case QEvent::TouchEnd: + return viewportEvent(e); + default: + break; + } + } + return QScrollArea::event(e); +} + class wxQtInternalScrollBar : public wxQtEventSignalHandler< QScrollBar, wxWindowQt > { public: