Commit 74a290ab authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

[Qt6] Port deprecated globalPos() to globalPosition()

parent 06aee5ff
......@@ -389,7 +389,11 @@ void CollapsibleEffectView::slotActivateEffect(bool active)
void CollapsibleEffectView::mousePressEvent(QMouseEvent *e)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_dragStart = e->globalPos();
#else
m_dragStart = e->globalPosition().toPoint();
#endif
if (!decoframe->property("active").toBool()) {
// Activate effect if not already active
emit activateEffect(m_model->row());
......@@ -399,7 +403,11 @@ void CollapsibleEffectView::mousePressEvent(QMouseEvent *e)
void CollapsibleEffectView::mouseMoveEvent(QMouseEvent *e)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if ((e->globalPos() - m_dragStart).manhattanLength() < QApplication::startDragDistance()) {
#else
if ((e->globalPosition().toPoint() - m_dragStart).manhattanLength() < QApplication::startDragDistance()) {
#endif
QPixmap pix = frame->grab();
emit startDrag(pix, m_model);
}
......
......@@ -760,7 +760,11 @@ void GLWidget::mousePressEvent(QMouseEvent *event)
m_dragStart = event->pos();
}
} else if ((event->button() & Qt::RightButton) != 0u) {
emit showContextMenu(event->globalPos());
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
emit showContextMenu(event->globalPos());
#else
emit showContextMenu(event->globalPosition().toPoint());
#endif
} else if ((event->button() & Qt::MiddleButton) != 0u) {
m_panStart = event->pos();
setCursor(Qt::ClosedHandCursor);
......
......@@ -842,7 +842,11 @@ void Monitor::mousePressEvent(QMouseEvent *event)
}
} else if (m_contextMenu) {
slotActivateMonitor();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_contextMenu->popup(event->globalPos());
#else
m_contextMenu->popup(event->globalPosition().toPoint());
#endif
event->accept();
}
QWidget::mousePressEvent(event);
......
......@@ -190,7 +190,11 @@ void TimelineWidget::setModel(const std::shared_ptr<TimelineItemModel> &model, M
void TimelineWidget::mousePressEvent(QMouseEvent *event)
{
emit focusProjectMonitor();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_clickPos = event->globalPos();
#else
m_clickPos = event->globalPosition().toPoint();
#endif
QQuickWidget::mousePressEvent(event);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment