qt: Migrate to Qt6. (#6418)

This commit is contained in:
Steveice10 2023-05-05 03:10:34 -07:00 committed by GitHub
parent 70335a7f4d
commit 2273df4d70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 299 additions and 464 deletions

View file

@ -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());
}
}

View file

@ -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();
}