Commit af5b0357 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECLARE_OVERRIDE

parent d7b3369e
......@@ -36,7 +36,7 @@ public:
/* updates displayed pixmap according to current cell state */
virtual void refresh();
virtual void reload(const QSize &size);
void reload(const QSize &size) Q_DECL_OVERRIDE;
protected:
virtual int getTilesize() const = 0;
......@@ -53,8 +53,8 @@ public:
OverviewCellItem(int x, int y, QSharedPointer<Picmi> game, QGraphicsItem *parent = 0);
protected:
virtual int getTilesize() const;
virtual QPixmap getPixmap() const;
int getTilesize() const Q_DECL_OVERRIDE;
QPixmap getPixmap() const Q_DECL_OVERRIDE;
};
class GameCellItem : public QObject, public CellItem
......@@ -67,19 +67,19 @@ public:
game and scene */
GameCellItem(int x, int y, QSharedPointer<Picmi> game, Scene *scene, QGraphicsItem *parent = 0);
void keyPressEvent(QKeyEvent *event);
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
void refresh();
void reload(const QSize &size);
void refresh() Q_DECL_OVERRIDE;
void reload(const QSize &size) Q_DECL_OVERRIDE;
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
virtual int getTilesize() const;
virtual QPixmap getPixmap() const;
int getTilesize() const Q_DECL_OVERRIDE;
QPixmap getPixmap() const Q_DECL_OVERRIDE;
private:
/** Converts scene- to game coordinates. */
......
......@@ -28,7 +28,7 @@ class PixmapItem : public QGraphicsPixmapItem, public ReloadableItem
{
public:
PixmapItem(Renderer::Resource resource, int x, int y, QGraphicsItem *parent = 0);
virtual void reload(const QSize &size);
void reload(const QSize &size) Q_DECL_OVERRIDE;
protected:
const Renderer::Resource m_resource;
......@@ -48,14 +48,14 @@ class StreakHBackgroundItem : public PixmapItem
{
public:
StreakHBackgroundItem(Renderer::Resource resource,int y, QGraphicsItem *parent = 0);
virtual void reload(const QSize &size);
void reload(const QSize &size) Q_DECL_OVERRIDE;
};
class StreakVBackgroundItem : public PixmapItem
{
public:
StreakVBackgroundItem(Renderer::Resource resource,int x, QGraphicsItem *parent = 0);
virtual void reload(const QSize &size);
void reload(const QSize &size) Q_DECL_OVERRIDE;
};
#endif // PIXMAPITEM_H
......@@ -34,7 +34,7 @@ public:
/* update displayed streak */
virtual void refresh() = 0;
virtual void reload(const QSize &size) = 0;
void reload(const QSize &size) Q_DECL_OVERRIDE = 0;
private slots:
void settingChanged(Settings::SettingsType type);
......@@ -51,16 +51,16 @@ class RowStreakItem : public StreakItem {
public:
RowStreakItem(QSharedPointer<Picmi> game, int y, QGraphicsItem *parent = 0);
void refresh();
void reload(const QSize &size);
void refresh() Q_DECL_OVERRIDE;
void reload(const QSize &size) Q_DECL_OVERRIDE;
};
class ColStreakItem : public StreakItem {
public:
ColStreakItem(QSharedPointer<Picmi> game, int x, QGraphicsItem *parent = 0);
void refresh();
void reload(const QSize &size);
void refresh() Q_DECL_OVERRIDE;
void reload(const QSize &size) Q_DECL_OVERRIDE;
};
#endif // STREAKITEM_H
......@@ -28,7 +28,7 @@ class TextBannerItem : public QGraphicsTextItem, public ReloadableItem
public:
TextBannerItem(QGraphicsItem *parent = 0);
void reload(const QSize &size);
void reload(const QSize &size) Q_DECL_OVERRIDE;
};
class PauseBannerItem : public TextBannerItem
......@@ -36,7 +36,7 @@ class PauseBannerItem : public TextBannerItem
public:
PauseBannerItem(QGraphicsItem *parent = 0);
void reload(const QSize &size);
void reload(const QSize &size) Q_DECL_OVERRIDE;
};
#endif // TEXTBANNERITEM_H
......@@ -42,7 +42,7 @@ public:
explicit MainWindow(QWidget *parent = 0);
protected:
void closeEvent(QCloseEvent *event);
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
private slots:
void startRandomGame();
......
......@@ -45,11 +45,11 @@ public:
ColumnCount /* not a real column */
};
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
private:
QList<QSharedPointer<Level> > &m_levels;
......
......@@ -37,8 +37,8 @@ public:
QSharedPointer<Level> selectedBoard() const;
protected:
void resizeEvent(QResizeEvent *event);
void showEvent(QShowEvent *event);
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
private slots:
void selectedLevelChanged(const QModelIndex &current, const QModelIndex &previous);
......
......@@ -36,7 +36,7 @@ public:
~SettingsWindow();
private slots:
void accept();
void accept() Q_DECL_OVERRIDE;
void bgToolButtonClicked();
void selectSolvedColor();
void selectUnsolvedColor();
......
......@@ -35,8 +35,8 @@ public:
void setPaused(bool paused);
protected:
void resizeEvent(QResizeEvent *event);
void keyPressEvent(QKeyEvent *event);
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
private:
QSharedPointer<Scene> m_scene;
......
......@@ -44,7 +44,7 @@ public:
IOHandlerNoHints(BoardMap *map, BoardState *state, ElapsedTime *timer) : IOHandler(map, state, timer) { }
protected:
void setBox(int x, int y);
void setBox(int x, int y) Q_DECL_OVERRIDE;
};
......@@ -63,7 +63,7 @@ public:
IOHandlerHints(BoardMap *map, BoardState *state, ElapsedTime *timer) : IOHandler(map, state, timer) { }
protected:
void setBox(int x, int y);
void setBox(int x, int y) Q_DECL_OVERRIDE;
};
......
......@@ -24,7 +24,7 @@
class OutOfBoundsException : public std::exception
{
public:
virtual const char *what() const throw() {
const char *what() const throw() {
return "index out of bounds";
}
};
......
......@@ -30,7 +30,7 @@ public:
~SystemException() throw() { }
virtual const char *what() const throw() {
const char *what() const throw() Q_DECL_OVERRIDE {
return m_msg.toLatin1();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment