From 56a51c783485e6e93e139d78ce8ea9f64377c67a Mon Sep 17 00:00:00 2001 From: Joel Bethke Date: Sun, 29 Nov 2020 01:33:13 -0600 Subject: [PATCH] ui: Fix Qt depreaction warnings (#4195) --- cockatrice/src/abstractcarditem.cpp | 4 ++-- cockatrice/src/abstractcounter.cpp | 2 +- cockatrice/src/chatview/chatview.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cockatrice/src/abstractcarditem.cpp b/cockatrice/src/abstractcarditem.cpp index 0f04fd6f9..5325409ef 100644 --- a/cockatrice/src/abstractcarditem.cpp +++ b/cockatrice/src/abstractcarditem.cpp @@ -287,14 +287,14 @@ void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event) } if (event->button() == Qt::LeftButton) setCursor(Qt::ClosedHandCursor); - else if (event->button() == Qt::MidButton) + else if (event->button() == Qt::MiddleButton) emit showCardInfoPopup(event->screenPos(), name); event->accept(); } void AbstractCardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if (event->button() == Qt::MidButton) + if (event->button() == Qt::MiddleButton) emit deleteCardInfoPopup(name); // This function ensures the parent function doesn't mess around with our selection. diff --git a/cockatrice/src/abstractcounter.cpp b/cockatrice/src/abstractcounter.cpp index 683de8dca..17057c969 100644 --- a/cockatrice/src/abstractcounter.cpp +++ b/cockatrice/src/abstractcounter.cpp @@ -127,7 +127,7 @@ void AbstractCounter::setValue(int _value) void AbstractCounter::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (isUnderMouse() && player->getLocalOrJudge()) { - if (event->button() == Qt::MidButton || (QApplication::keyboardModifiers() & Qt::ShiftModifier)) { + if (event->button() == Qt::MiddleButton || (QApplication::keyboardModifiers() & Qt::ShiftModifier)) { if (menu) menu->exec(event->screenPos()); event->accept(); diff --git a/cockatrice/src/chatview/chatview.cpp b/cockatrice/src/chatview/chatview.cpp index 9d28c66dc..3dc88061d 100644 --- a/cockatrice/src/chatview/chatview.cpp +++ b/cockatrice/src/chatview/chatview.cpp @@ -529,12 +529,12 @@ void ChatView::mousePressEvent(QMouseEvent *event) { switch (hoveredItemType) { case HoveredCard: { - if ((event->button() == Qt::MidButton) || (event->button() == Qt::LeftButton)) + if ((event->button() == Qt::MiddleButton) || (event->button() == Qt::LeftButton)) emit showCardInfoPopup(event->globalPos(), hoveredContent); break; } case HoveredUser: { - if (event->button() != Qt::MidButton) { + if (event->button() != Qt::MiddleButton) { const int delimiterIndex = hoveredContent.indexOf("_"); const QString userName = hoveredContent.mid(delimiterIndex + 1); switch (event->button()) { @@ -564,7 +564,7 @@ void ChatView::mousePressEvent(QMouseEvent *event) void ChatView::mouseReleaseEvent(QMouseEvent *event) { - if ((event->button() == Qt::MidButton) || (event->button() == Qt::LeftButton)) + if ((event->button() == Qt::MiddleButton) || (event->button() == Qt::LeftButton)) emit deleteCardInfoPopup(QString("_")); QTextBrowser::mouseReleaseEvent(event);