qt: Migrate to Qt6. (#6418)
This commit is contained in:
@@ -40,8 +40,9 @@ void SurfacePicture::mousePressEvent(QMouseEvent* event) {
|
||||
}
|
||||
|
||||
if (surface_widget) {
|
||||
surface_widget->Pick(event->x() * pixmap.width() / width(),
|
||||
event->y() * pixmap.height() / height());
|
||||
const auto pos = event->position().toPoint();
|
||||
surface_widget->Pick(pos.x() * pixmap.width() / width(),
|
||||
pos.y() * pixmap.height() / height());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -142,24 +142,28 @@ void MicroProfileWidget::hideEvent(QHideEvent* event) {
|
||||
}
|
||||
|
||||
void MicroProfileWidget::mouseMoveEvent(QMouseEvent* event) {
|
||||
MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale, 0);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MicroProfileWidget::mousePressEvent(QMouseEvent* event) {
|
||||
MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale, 0);
|
||||
MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* event) {
|
||||
MicroProfileMousePosition(event->x() / x_scale, event->y() / y_scale, 0);
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale, 0);
|
||||
MicroProfileMouseButton(event->buttons() & Qt::LeftButton, event->buttons() & Qt::RightButton);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void MicroProfileWidget::wheelEvent(QWheelEvent* event) {
|
||||
MicroProfileMousePosition(event->position().x() / x_scale, event->position().y() / y_scale,
|
||||
const auto point = event->position().toPoint();
|
||||
MicroProfileMousePosition(point.x() / x_scale, point.y() / y_scale,
|
||||
event->angleDelta().y() / 120);
|
||||
event->accept();
|
||||
}
|
||||
|
Reference in New Issue
Block a user