Fix Mac Builds (#4844)

This commit is contained in:
Zach H 2023-08-06 22:45:45 -04:00 committed by GitHub
parent e3552fc0ae
commit 8c539351e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 25 deletions

View file

@ -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?

View file

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

View file

@ -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

View file

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

View file

@ -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<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &dropPoint);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
void reorganizeCards() override;
void handleDropEvent(const QList<CardDragItem *> &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

View file

@ -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+)");

View file

@ -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

View file

@ -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