diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-08-03 12:47:30 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-08-24 13:01:33 +0300 |
commit | 5543117f5b86cd032d881b9a7d317428dda24dff (patch) | |
tree | 9d11ccdf05105cfba8942850e0b3e162f0c8da51 /qt | |
parent | 165814ca6b9bcdaf84ce79a0843e0f878966ee3b (diff) |
UserEvent refactoring.
Diffstat (limited to 'qt')
-rw-r--r-- | qt/draw_widget.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp index 16a8c45380..9c649fb0e5 100644 --- a/qt/draw_widget.cpp +++ b/qt/draw_widget.cpp @@ -425,10 +425,12 @@ void DrawWidget::keyPressEvent(QKeyEvent * e) e->key() == Qt::Key_Control) { df::TouchEvent event; - event.m_type = df::TouchEvent::TOUCH_DOWN; - event.m_touches[0].m_id = 0; - event.m_touches[0].m_location = m2::PointD(L2D(QCursor::pos().x()), L2D(QCursor::pos().y())); - event.m_touches[1] = GetSymmetrical(event.m_touches[0]); + event.SetTouchType(df::TouchEvent::TOUCH_DOWN); + df::Touch touch; + touch.m_id = 0; + touch.m_location = m2::PointD(L2D(QCursor::pos().x()), L2D(QCursor::pos().y())); + event.SetFirstTouch(touch); + event.SetSecondTouch(GetSymmetrical(touch)); m_framework->TouchEvent(event); } @@ -442,10 +444,12 @@ void DrawWidget::keyReleaseEvent(QKeyEvent * e) e->key() == Qt::Key_Control) { df::TouchEvent event; - event.m_type = df::TouchEvent::TOUCH_UP; - event.m_touches[0].m_id = 0; - event.m_touches[0].m_location = m2::PointD(L2D(QCursor::pos().x()), L2D(QCursor::pos().y())); - event.m_touches[1] = GetSymmetrical(event.m_touches[0]); + event.SetTouchType(df::TouchEvent::TOUCH_UP); + df::Touch touch; + touch.m_id = 0; + touch.m_location = m2::PointD(L2D(QCursor::pos().x()), L2D(QCursor::pos().y())); + event.SetFirstTouch(touch); + event.SetSecondTouch(GetSymmetrical(touch)); m_framework->TouchEvent(event); } @@ -645,10 +649,10 @@ df::Touch DrawWidget::GetSymmetrical(df::Touch const & touch) df::TouchEvent DrawWidget::GetTouchEvent(QMouseEvent * e, df::TouchEvent::ETouchType type) { df::TouchEvent event; - event.m_type = type; - event.m_touches[0] = GetTouch(e); + event.SetTouchType(type); + event.SetFirstTouch(GetTouch(e)); if (IsRotation(e)) - event.m_touches[1] = GetSymmetrical(event.m_touches[0]); + event.SetSecondTouch(GetSymmetrical(event.GetFirstTouch())); return event; } |