Create local variables for mouse and wheel positions
This commit is contained in:
parent
818651909f
commit
39b3c9022d
|
@ -143,25 +143,29 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) {
|
void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0);
|
const auto mouse_position = ev->pos();
|
||||||
|
MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) {
|
void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0);
|
const auto mouse_position = ev->pos();
|
||||||
|
MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
|
||||||
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
|
void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0);
|
const auto mouse_position = ev->pos();
|
||||||
|
MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
|
||||||
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
|
void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
|
||||||
MicroProfileMousePosition(ev->position().toPoint().x() / x_scale,
|
const auto wheel_position = ev->position().toPoint();
|
||||||
ev->position().toPoint().y() / y_scale, ev->angleDelta().y() / 120);
|
MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale,
|
||||||
|
ev->angleDelta().y() / 120);
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue