void widgetMouseMoveEvent( QMouseEvent *mouseEvent ) { if (!mEnabled) return; QPoint pos = mouseEvent->pos(); if (pos != mInitialPos) { moveCanvas(pos.x() - mInitialPos.x(), pos.y() - mInitialPos.y()); mInitialPos = mouseEvent->pos(); } }
int QwtPlotPanner::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QwtPanner::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: moveCanvas((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; } _id -= 1; } return _id; }
void Panner::moveAxes(int dx, int dy) { moveCanvas(dx - m_lastX, dy - m_lastY); m_lastX = dx; m_lastY = dy; }
void Panner::finished(int dx, int dy) { moveCanvas(dx - m_lastX, dy - m_lastY); m_lastX = m_lastY = 0; }