Do you help me look at my code?
Code:
void MSCSettingsWidget::mouseMoveEvent(QMouseEvent *evt)
{
if (!evt->modifiers().testFlag(Qt::ShiftModifier)) {
QPoint pos = evt->pos();
int distance = 0;
scrollDirection = scrollMagnitude = 0;
// determine the direction of automatic scrolling
if (pos.x() < SCROLL_DISTANCE) {
scrollDirection = Left;
distance = pos.x();
this->move(distance,0);
}
else if (width() - pos.x() < SCROLL_DISTANCE) {
scrollDirection = Right;
distance = width() - pos.x();
this->move(distance,0);
}
if (pos.y() < SCROLL_DISTANCE) {
scrollDirection |= Up;
distance = pos.y();
this->move(0,distance);
}
else if (height() - pos.y() < SCROLL_DISTANCE) {
scrollDirection |= Down;
distance = height() - pos.y();
this->move(0,distance);
}
if (scrollDirection) {
scrollMagnitude = qRound((SCROLL_DISTANCE - distance) / 8);
}
rubberBand->setGeometry(QRect(origin, evt->pos()).normalized());
}
// QGraphicsView::mouseMoveEvent( evt);
}