diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 8efe8bfb..5ccf2462 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -201,7 +201,7 @@ jobs: - target: Debug # tests only os: macos-latest xcode: 14.2 - qt_version: 6.* + qt_version: 6.5 qt_modules: "qtmultimedia qtwebsockets" type: Debug do_tests: 1 @@ -251,7 +251,8 @@ jobs: install_qt: ${{matrix.qt_version}} run: | brew update - brew install protobuf + brew install protobuf@21 + brew link --force protobuf@21 if [[ $install_qt == homebrew ]]; then brew install qt --force-bottle else # for some reason the tests fail with the action installed qt? diff --git a/CMakeLists.txt b/CMakeLists.txt index a278ee0a..f151b5fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,7 +179,7 @@ else() # other: osx/llvm, bsd/llvm set(CMAKE_CXX_FLAGS_RELEASE "-O2") if(WARNING_AS_ERROR) - set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror") + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror -Wno-unused-parameter") else() set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra") endif() diff --git a/cockatrice/src/abstractcarddragitem.h b/cockatrice/src/abstractcarddragitem.h index 4f379e87..682c2a6b 100644 --- a/cockatrice/src/abstractcarddragitem.h +++ b/cockatrice/src/abstractcarddragitem.h @@ -21,18 +21,18 @@ public: { Type = typeCardDrag }; - int type() const + int type() const override { return Type; } AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0); ~AbstractCardDragItem(); - QRectF boundingRect() const + QRectF boundingRect() const override { return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT); } QPainterPath shape() const override; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; AbstractCardItem *getItem() const { return item; @@ -45,7 +45,7 @@ public: virtual void updatePosition(const QPointF &cursorScenePos) = 0; protected: - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; }; #endif diff --git a/cockatrice/src/abstractcarditem.h b/cockatrice/src/abstractcarditem.h index 7800eb8f..98ef4d1a 100644 --- a/cockatrice/src/abstractcarditem.h +++ b/cockatrice/src/abstractcarditem.h @@ -44,7 +44,7 @@ public: { Type = typeCard }; - int type() const + int type() const override { return Type; } @@ -53,11 +53,11 @@ public: int _id = -1, QGraphicsItem *parent = nullptr); ~AbstractCardItem(); - QRectF boundingRect() const; + QRectF boundingRect() const override; QPainterPath shape() const override; QSizeF getTranslatedSize(QPainter *painter) const; void paintPicture(QPainter *painter, const QSizeF &translatedSize, int angle); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; CardInfoPtr getInfo() const { return info; @@ -104,9 +104,9 @@ public: protected: void transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle); - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value); + void mousePressEvent(QGraphicsSceneMouseEvent *event) override; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; + QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override; void cacheBgColor(); }; diff --git a/cockatrice/src/pilezone.h b/cockatrice/src/pilezone.h index 9c2e5cd3..6e405b6b 100644 --- a/cockatrice/src/pilezone.h +++ b/cockatrice/src/pilezone.h @@ -18,18 +18,18 @@ public: bool _isShufflable, bool _contentsKnown, QGraphicsItem *parent = nullptr); - QRectF boundingRect() const; + QRectF boundingRect() const override; QPainterPath shape() const override; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); - void reorganizeCards(); - void handleDropEvent(const QList &dragItems, CardZone *startZone, const QPoint &dropPoint); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; + void reorganizeCards() override; + void handleDropEvent(const QList &dragItems, CardZone *startZone, const QPoint &dropPoint) override; protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void hoverEnterEvent(QGraphicsSceneHoverEvent *event); - void addCardImpl(CardItem *card, int x, int y); + void mousePressEvent(QGraphicsSceneMouseEvent *event) override; + void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; + void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override; + void addCardImpl(CardItem *card, int x, int y) override; }; #endif diff --git a/cockatrice/src/releasechannel.cpp b/cockatrice/src/releasechannel.cpp index 095c4900..31a26818 100644 --- a/cockatrice/src/releasechannel.cpp +++ b/cockatrice/src/releasechannel.cpp @@ -42,7 +42,7 @@ void ReleaseChannel::checkForUpdates() } // Different release channel checking functions for different operating systems -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName) { static QRegularExpression version_regex("macOS-(\\d+)\\.(\\d+)"); diff --git a/common/room_message_type.h b/common/room_message_type.h index 4e87bd86..7b7ad9ac 100644 --- a/common/room_message_type.h +++ b/common/room_message_type.h @@ -1,7 +1,7 @@ #ifndef ROOM_MESSAGE_TYPE_H #define ROOM_MESSAGE_TYPE_H -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // avoid collision from Mac OS X's ConditionalMacros.h // https://github.com/protocolbuffers/protobuf/issues/119 #undef TYPE_BOOL diff --git a/common/user_level.h b/common/user_level.h index c682a93b..5d720c0a 100644 --- a/common/user_level.h +++ b/common/user_level.h @@ -1,7 +1,7 @@ #ifndef USER_LEVEL_H #define USER_LEVEL_H -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // avoid collision from Mac OS X's ConditionalMacros.h // https://github.com/protocolbuffers/protobuf/issues/119 #undef TYPE_BOOL