summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-06-01 22:54:02 +0200
committerMontel Laurent <[email protected]>2017-06-01 22:54:02 +0200
commit165b779c35d9aa069cfe5bb7c63bfb7c9b64b663 (patch)
treee3f530f3712edb716728b2dfbd55b61686ca181c
parentc4a1f99eb40ee9f69bf142347fe5c5c2c99e2a80 (diff)
Use Q_DECLARE_OVERRIDE
-rw-r--r--dialogs/fleetdlg.h2
-rw-r--r--dialogs/newgamedlg.cc18
-rw-r--r--gameview.h4
-rw-r--r--localgame.h6
-rw-r--r--mainwin.h2
-rw-r--r--map/mapitems.h14
-rw-r--r--map/mapscene.h2
-rw-r--r--map/mapview.h4
-rw-r--r--minimapview.h4
-rw-r--r--players/ai/becai/becai.h2
-rw-r--r--players/ai/becai/becai_gui.h2
-rw-r--r--players/ai/default/default.h2
-rw-r--r--players/ai/default/hard_gui.h2
-rw-r--r--players/ai/default/normal_gui.h2
-rw-r--r--players/ai/default/weak_gui.h2
-rw-r--r--players/computerplayer.h4
-rw-r--r--players/localplayer.h2
-rw-r--r--players/localplayer_gui.h2
-rw-r--r--players/neutralplayer.h6
-rw-r--r--players/player.h4
-rw-r--r--players/spectatorplayer.h4
-rw-r--r--players/spectatorplayer_gui.h2
-rw-r--r--view/standingswidget.h2
23 files changed, 47 insertions, 47 deletions
diff --git a/dialogs/fleetdlg.h b/dialogs/fleetdlg.h
index 4127226..51b632c 100644
--- a/dialogs/fleetdlg.h
+++ b/dialogs/fleetdlg.h
@@ -39,7 +39,7 @@ public:
const AttackFleetList &standingOrders );
AttackFleetList *uncheckedFleets();
- QSize sizeHint() const;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
private:
void update();
diff --git a/dialogs/newgamedlg.cc b/dialogs/newgamedlg.cc
index 1b81997..80172f1 100644
--- a/dialogs/newgamedlg.cc
+++ b/dialogs/newgamedlg.cc
@@ -93,18 +93,18 @@ public:
}
}
- int rowCount(const QModelIndex &index = QModelIndex()) const
+ int rowCount(const QModelIndex &index = QModelIndex()) const Q_DECL_OVERRIDE
{
Q_UNUSED(index);
return m_players.count();
}
- int columnCount(const QModelIndex&) const
+ int columnCount(const QModelIndex&) const Q_DECL_OVERRIDE
{
return 2;
}
- QVariant data(const QModelIndex &index, int role) const
+ QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE
{
if (index.isValid())
{
@@ -130,7 +130,7 @@ public:
return QVariant();
}
- QVariant headerData(int section, Qt::Orientation orientation, int role) const
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
{
@@ -140,7 +140,7 @@ public:
return QVariant();
}
- bool setData(const QModelIndex &index, const QVariant &value, int)
+ bool setData(const QModelIndex &index, const QVariant &value, int) Q_DECL_OVERRIDE
{
bool result = false;
if (index.isValid())
@@ -216,7 +216,7 @@ public:
return player;
}
- Qt::ItemFlags flags(const QModelIndex &) const
+ Qt::ItemFlags flags(const QModelIndex &) const Q_DECL_OVERRIDE
{
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
}
@@ -278,7 +278,7 @@ public:
{
}
- QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const
+ QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const Q_DECL_OVERRIDE
{
if (index.column() == 0)
return new QLineEdit(parent);
@@ -286,7 +286,7 @@ public:
return new QComboBox(parent);
}
- void setEditorData(QWidget *editor, const QModelIndex &index) const
+ void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE
{
if (index.column() != 0) {
QComboBox *cbox = static_cast<QComboBox*>(editor);
@@ -302,7 +302,7 @@ public:
}
}
- void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
+ void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE
{
if (index.column() != 0) {
QComboBox *cbox = static_cast<QComboBox*>(editor);
diff --git a/gameview.h b/gameview.h
index e5ae6cd..ffcd595 100644
--- a/gameview.h
+++ b/gameview.h
@@ -107,8 +107,8 @@ signals:
// Event Handlers
//***************************************************************
protected:
- virtual void keyPressEvent( QKeyEvent * );
- virtual void resizeEvent ( QResizeEvent * event );
+ void keyPressEvent( QKeyEvent * ) Q_DECL_OVERRIDE;
+ void resizeEvent ( QResizeEvent * event ) Q_DECL_OVERRIDE;
private slots:
void gameOver();
diff --git a/localgame.h b/localgame.h
index ca3b11f..3b004bf 100644
--- a/localgame.h
+++ b/localgame.h
@@ -28,8 +28,8 @@ class LocalGame : public Game
public:
explicit LocalGame(QObject *parent = 0);
- virtual void start();
- virtual void stop();
+ void start() Q_DECL_OVERRIDE;
+ void stop() Q_DECL_OVERRIDE;
signals:
public slots:
@@ -37,7 +37,7 @@ public slots:
void playerIsDone();
protected:
- virtual void buildMachine();
+ void buildMachine() Q_DECL_OVERRIDE;
};
#endif // LOCALGAME_H
diff --git a/mainwin.h b/mainwin.h
index 8bfd382..c0883dd 100644
--- a/mainwin.h
+++ b/mainwin.h
@@ -41,7 +41,7 @@ public:
MainWindow();
~MainWindow();
- QSize sizeHint() const;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
private:
void setupActions();
diff --git a/map/mapitems.h b/map/mapitems.h
index a3985ee..b4aad60 100644
--- a/map/mapitems.h
+++ b/map/mapitems.h
@@ -38,13 +38,13 @@ public:
explicit PlanetItem(MapScene *scene, Sector *sector, Game *game);
~PlanetItem() {}
- QRectF boundingRect() const;
+ QRectF boundingRect() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
- QWidget *widget);
+ QWidget *widget) Q_DECL_OVERRIDE;
- void hoverEnterEvent ( QGraphicsSceneHoverEvent *event );
- void hoverLeaveEvent ( QGraphicsSceneHoverEvent *event );
- void mousePressEvent ( QGraphicsSceneMouseEvent *event );
+ void hoverEnterEvent ( QGraphicsSceneHoverEvent *event ) Q_DECL_OVERRIDE;
+ void hoverLeaveEvent ( QGraphicsSceneHoverEvent *event ) Q_DECL_OVERRIDE;
+ void mousePressEvent ( QGraphicsSceneMouseEvent *event ) Q_DECL_OVERRIDE;
void unselect ();
void select ();
Sector *sector () { return m_sector; }
@@ -78,11 +78,11 @@ public:
explicit PlanetInfoItem(Game*);
~PlanetInfoItem() {}
- QRectF boundingRect() const;
+ QRectF boundingRect() const Q_DECL_OVERRIDE;
void setPlanet (Planet *planet);
Planet *planet () { return m_planet; }
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
- QWidget *widget);
+ QWidget *widget) Q_DECL_OVERRIDE;
private:
Game *m_game;
diff --git a/map/mapscene.h b/map/mapscene.h
index e585584..7bb3fb1 100644
--- a/map/mapscene.h
+++ b/map/mapscene.h
@@ -63,7 +63,7 @@ class MapScene: public QGraphicsScene
void displayPlanetInfo(Planet *planet);
- void drawBackground( QPainter * painter, const QRectF & rect );
+ void drawBackground( QPainter * painter, const QRectF & rect ) Q_DECL_OVERRIDE;
/**
diff --git a/map/mapview.h b/map/mapview.h
index 5eb3e93..3f38997 100644
--- a/map/mapview.h
+++ b/map/mapview.h
@@ -33,8 +33,8 @@ public:
explicit MapView( MapScene* scene, QWidget *parent = 0 );
private:
- virtual void resizeEvent( QResizeEvent* );
- virtual QSize sizeHint() const;
+ void resizeEvent( QResizeEvent* ) Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
MapScene* m_scene;
};
diff --git a/minimapview.h b/minimapview.h
index db117bd..e6e3738 100644
--- a/minimapview.h
+++ b/minimapview.h
@@ -52,8 +52,8 @@ signals:
void sectorSelected(const Coordinate &coord);
protected:
- void mousePressEvent(QMouseEvent *event);
- void paintEvent(QPaintEvent *event);
+ void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
void CalculateOffsets(float &, float &, float &);
diff --git a/players/ai/becai/becai.h b/players/ai/becai/becai.h
index 1a2732c..c126ffa 100644
--- a/players/ai/becai/becai.h
+++ b/players/ai/becai/becai.h
@@ -33,7 +33,7 @@ class AiBecai : public ComputerPlayer
public:
explicit AiBecai(Game *game, const QString &newName, const QColor &color);
- virtual void play();
+ void play() Q_DECL_OVERRIDE;
private:
int getMinimumDefenceFleetSize(Planet *planet, int minimumBaseDefenceFleetSize, double averageOwnKillPercentage, double averageOwnProduction);
diff --git a/players/ai/becai/becai_gui.h b/players/ai/becai/becai_gui.h
index d2197ce..a08952a 100644
--- a/players/ai/becai/becai_gui.h
+++ b/players/ai/becai/becai_gui.h
@@ -26,7 +26,7 @@ class AiBecaiGui : public PlayerGui
{
public:
explicit AiBecaiGui();
- virtual Player* createInstance(Game *game, const QString &newName, const QColor &color) const;
+ Player* createInstance(Game *game, const QString &newName, const QColor &color) const Q_DECL_OVERRIDE;
};
#endif // AI_BECAI_GUI_H
diff --git a/players/ai/default/default.h b/players/ai/default/default.h
index 29bb8a3..e4602d9 100644
--- a/players/ai/default/default.h
+++ b/players/ai/default/default.h
@@ -34,7 +34,7 @@ protected:
AiLevel aiLevel() const { return m_level; }
- virtual void play();
+ void play() Q_DECL_OVERRIDE;
signals:
diff --git a/players/ai/default/hard_gui.h b/players/ai/default/hard_gui.h
index 755b084..b7bb359 100644
--- a/players/ai/default/hard_gui.h
+++ b/players/ai/default/hard_gui.h
@@ -26,7 +26,7 @@ class AiDefaultHardGui : public PlayerGui
{
public:
explicit AiDefaultHardGui();
- virtual Player* createInstance(Game *game, const QString &newName, const QColor &color) const;
+ Player* createInstance(Game *game, const QString &newName, const QColor &color) const Q_DECL_OVERRIDE;
};
#endif // AI_DEFAULT_HARD_GUI_H
diff --git a/players/ai/default/normal_gui.h b/players/ai/default/normal_gui.h
index ea9f5d5..620a0f8 100644
--- a/players/ai/default/normal_gui.h
+++ b/players/ai/default/normal_gui.h
@@ -26,7 +26,7 @@ class AiDefaultNormalGui : public PlayerGui
{
public:
explicit AiDefaultNormalGui();
- virtual Player* createInstance(Game *game, const QString &newName, const QColor &color) const;
+ Player* createInstance(Game *game, const QString &newName, const QColor &color) const Q_DECL_OVERRIDE;
};
#endif // AI_DEFAULT_NORMAL_GUI_H
diff --git a/players/ai/default/weak_gui.h b/players/ai/default/weak_gui.h
index 147d738..8bfcc76 100644
--- a/players/ai/default/weak_gui.h
+++ b/players/ai/default/weak_gui.h
@@ -26,7 +26,7 @@ class AiDefaultWeakGui : public PlayerGui
{
public:
explicit AiDefaultWeakGui();
- virtual Player* createInstance(Game *game, const QString &newName, const QColor &color) const;
+ Player* createInstance(Game *game, const QString &newName, const QColor &color) const Q_DECL_OVERRIDE;
};
#endif // AI_DEFAULT_WEAK_GUI_H
diff --git a/players/computerplayer.h b/players/computerplayer.h
index e0637e5..5a36c93 100644
--- a/players/computerplayer.h
+++ b/players/computerplayer.h
@@ -33,8 +33,8 @@ class ComputerPlayer : public Player
protected:
explicit ComputerPlayer(Game *game, const QString &newName, const QColor &color);
- virtual bool isAiPlayer();
- virtual void play() = 0;
+ bool isAiPlayer() Q_DECL_OVERRIDE;
+ void play() Q_DECL_OVERRIDE = 0;
signals:
diff --git a/players/localplayer.h b/players/localplayer.h
index ce1ca86..b792abc 100644
--- a/players/localplayer.h
+++ b/players/localplayer.h
@@ -31,7 +31,7 @@ class LocalPlayer : public Player
public:
explicit LocalPlayer(Game *game, const QString &newName, const QColor &color);
- virtual void play();
+ void play() Q_DECL_OVERRIDE;
void done();
signals:
diff --git a/players/localplayer_gui.h b/players/localplayer_gui.h
index 0ddc09b..026198e 100644
--- a/players/localplayer_gui.h
+++ b/players/localplayer_gui.h
@@ -26,7 +26,7 @@ class LocalPlayerGui : public PlayerGui
{
public:
explicit LocalPlayerGui();
- virtual Player* createInstance(Game *game, const QString &newName, const QColor &color) const;
+ Player* createInstance(Game *game, const QString &newName, const QColor &color) const Q_DECL_OVERRIDE;
};
#endif // LOCAL_PLAYER_GUI_H
diff --git a/players/neutralplayer.h b/players/neutralplayer.h
index fa25b56..3efbbb7 100644
--- a/players/neutralplayer.h
+++ b/players/neutralplayer.h
@@ -38,12 +38,12 @@ class NeutralPlayer : public Player
public:
explicit NeutralPlayer(Game *game);
- virtual bool isDead();
+ bool isDead() Q_DECL_OVERRIDE;
- virtual bool isNeutral();
+ bool isNeutral() Q_DECL_OVERRIDE;
protected:
- virtual void play();
+ void play() Q_DECL_OVERRIDE;
signals:
diff --git a/players/player.h b/players/player.h
index 086b529..62fd28e 100644
--- a/players/player.h
+++ b/players/player.h
@@ -78,8 +78,8 @@ public:
protected:
virtual void play() = 0;
- virtual void onEntry (QEvent *event);
- virtual void onExit (QEvent *event);
+ void onEntry (QEvent *event) Q_DECL_OVERRIDE;
+ void onExit (QEvent *event) Q_DECL_OVERRIDE;
Game *m_game;
signals:
diff --git a/players/spectatorplayer.h b/players/spectatorplayer.h
index db7e74d..1621d4b 100644
--- a/players/spectatorplayer.h
+++ b/players/spectatorplayer.h
@@ -37,8 +37,8 @@ class SpectatorPlayer : public LocalPlayer
public:
explicit SpectatorPlayer(Game *game, const QString &newName, const QColor &color);
- virtual bool isDead();
- virtual bool isSpectator();
+ bool isDead() Q_DECL_OVERRIDE;
+ bool isSpectator() Q_DECL_OVERRIDE;
signals:
diff --git a/players/spectatorplayer_gui.h b/players/spectatorplayer_gui.h
index ec0a123..9f2edb7 100644
--- a/players/spectatorplayer_gui.h
+++ b/players/spectatorplayer_gui.h
@@ -26,7 +26,7 @@ class SpectatorPlayerGui : public PlayerGui
{
public:
explicit SpectatorPlayerGui();
- virtual Player* createInstance(Game *game, const QString &newName, const QColor &color) const;
+ Player* createInstance(Game *game, const QString &newName, const QColor &color) const Q_DECL_OVERRIDE;
};
#endif // SPECTATOR_PLAYER_GUI_H
diff --git a/view/standingswidget.h b/view/standingswidget.h
index b3bb2cc..0a241cb 100644
--- a/view/standingswidget.h
+++ b/view/standingswidget.h
@@ -40,7 +40,7 @@ public:
explicit StandingsWidget(QWidget *parent, const QList<Player *> players);
~StandingsWidget();
- QSize sizeHint() const;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
void update(const QList<Player *> players);
private: