Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion deflect/qt/EventReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ void EventReceiver::_onEvent( int socket )
case Event::EVT_VIEW_SIZE_CHANGED:
emit resized( deflectEvent.dx, deflectEvent.dy );
break;
case Event::EVT_WHEEL:
emit wheeled( deflectEvent.mouseX, deflectEvent.mouseY,
deflectEvent.dy );
break;

case Event::EVT_CLICK:
case Event::EVT_DOUBLECLICK:
case Event::EVT_WHEEL:
case Event::EVT_SWIPE_LEFT:
case Event::EVT_SWIPE_RIGHT:
case Event::EVT_SWIPE_UP:
Expand Down
1 change: 1 addition & 0 deletions deflect/qt/EventReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class EventReceiver : public QObject
void released( double x, double y );
void moved( double x, double y );
void resized( double x, double y );
void wheeled( double x, double y, double dy );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a funny verb :-)


private slots:
void _onEvent( int socket );
Expand Down
23 changes: 17 additions & 6 deletions deflect/qt/QmlStreamerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,28 +229,36 @@ void QmlStreamer::Impl::_requestUpdate()

void QmlStreamer::Impl::_onPressed( double x_, double y_ )
{
QPoint point( x_ * width(), y_ * height( ));
const QPoint point( x_ * width(), y_ * height( ));
QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, point,
Qt::LeftButton, Qt::LeftButton,
Qt::NoModifier );
QCoreApplication::postEvent( this, e );
QCoreApplication::postEvent( _quickWindow, e );
}

void QmlStreamer::Impl::_onMoved( double x_, double y_ )
{
QPoint point( x_ * width(), y_ * height( ));
const QPoint point( x_ * width(), y_ * height( ));
QMouseEvent* e = new QMouseEvent( QEvent::MouseMove, point, Qt::LeftButton,
Qt::LeftButton, Qt::NoModifier );
QCoreApplication::postEvent( this, e );
QCoreApplication::postEvent( _quickWindow, e );
}

void QmlStreamer::Impl::_onReleased( double x_, double y_ )
{
QPoint point( x_ * width(), y_ * height( ));
const QPoint point( x_ * width(), y_ * height( ));
QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonRelease, point,
Qt::LeftButton, Qt::NoButton,
Qt::NoModifier );
QCoreApplication::postEvent( this, e );
QCoreApplication::postEvent( _quickWindow, e );
}

void QmlStreamer::Impl::_onWheeled( double x_, double y_, double deltaY )
{
const QPoint point( x_ * width(), y_ * height( ));
QWheelEvent* e = new QWheelEvent( point, deltaY, Qt::NoButton,
Qt::NoModifier, Qt::Vertical );
QCoreApplication::postEvent( _quickWindow, e );
}

void QmlStreamer::Impl::_onResized( double x_, double y_ )
Expand Down Expand Up @@ -341,6 +349,9 @@ bool QmlStreamer::Impl::_setupDeflectStream()
this, &QmlStreamer::Impl::_onMoved );
connect( _eventHandler, &EventReceiver::resized,
this, &QmlStreamer::Impl::_onResized );
connect( _eventHandler, &EventReceiver::wheeled,
this, &QmlStreamer::Impl::_onWheeled );

return true;
}

Expand Down
1 change: 1 addition & 0 deletions deflect/qt/QmlStreamerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private slots:
void _onReleased( double, double );
void _onMoved( double, double );
void _onResized( double, double );
void _onWheeled( double, double, double );

private:
bool _setupDeflectStream();
Expand Down
4 changes: 3 additions & 1 deletion doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Changelog {#Changelog}

## Deflect 0.9 (git master)

* [60](https://github.com/BlueBrain/Deflect/pull/60):
* [64](https://github.com/BlueBrain/Deflect/pull/64):
QmlStreamer: Fix event forwarding, implement wheel event support
* [60](https://github.com/BlueBrain/Deflect/pull/60):
Improved DesktopStreamer: removed selection rectangle, editable list of stream
hostnames

Expand Down