add missing override and explicit specifiers to all classes in src/game (#5511)

This commit is contained in:
RickyRister 2025-01-22 04:57:56 -08:00 committed by GitHub
parent af161f00b7
commit 66e2e7a473
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 140 additions and 137 deletions

View file

@ -88,7 +88,7 @@ public:
AbstractCounterDialog(const QString &name, const QString &value, QWidget *parent = nullptr);
protected:
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) override;
void changeValue(int diff);
};

View file

@ -24,7 +24,7 @@ protected:
void paintNumberEllipse(int number, int radius, const QColor &color, int position, int count, QPainter *painter);
public:
AbstractGraphicsItem(QGraphicsItem *parent = nullptr) : QObject(), QGraphicsItem(parent)
explicit AbstractGraphicsItem(QGraphicsItem *parent = nullptr) : QGraphicsItem(parent)
{
}
};

View file

@ -24,17 +24,17 @@ protected:
bool targetLocked;
QColor color;
bool fullColor;
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
public:
ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTarget *_targetItem, const QColor &color);
~ArrowItem();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QRectF boundingRect() const
~ArrowItem() override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
QRectF boundingRect() const override
{
return path.boundingRect();
}
QPainterPath shape() const
QPainterPath shape() const override
{
return path;
}
@ -83,8 +83,8 @@ public:
void addChildArrow(ArrowDragItem *childArrow);
protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
};
class ArrowAttachItem : public ArrowItem
@ -96,12 +96,12 @@ private:
void attachCards(CardItem *startCard, const CardItem *targetCard);
public:
ArrowAttachItem(ArrowTarget *_startItem);
explicit ArrowAttachItem(ArrowTarget *_startItem);
void addChildArrow(ArrowAttachItem *childArrow);
protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
};
#endif // ARROWITEM_H

View file

@ -19,8 +19,8 @@ private:
QList<ArrowItem *> arrowsFrom, arrowsTo;
public:
ArrowTarget(Player *_owner, QGraphicsItem *parent = nullptr);
~ArrowTarget();
explicit ArrowTarget(Player *_owner, QGraphicsItem *parent = nullptr);
~ArrowTarget() override;
Player *getOwner() const
{

View file

@ -20,8 +20,8 @@ public:
bool useNameForShortcut = false,
QGraphicsItem *parent = nullptr,
QWidget *game = nullptr);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
};
#endif