Commit 0161b438 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECLARE_OVERRIDE

parent 80c0ac73
......@@ -26,19 +26,19 @@ Q_OBJECT
boxAsker(QWidget *parent, KGmap *m, QWidget *w, uint count);
~boxAsker();
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
public slots:
void updateLayout();
protected:
virtual bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) = 0;
void nextQuestionHook(const QString &division);
void nextQuestionHook(const QString &division) Q_DECL_OVERRIDE;
void setQuestion(const QString &q);
virtual void setAnswerHook(int userSays) = 0;
void keyPressEvent(QKeyEvent *e);
void keyReleaseEvent(QKeyEvent *e);
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
void setHeadWidget(QWidget *headWidget);
QVector<QRadioButton*> p_radioButtons;
......
......@@ -20,10 +20,10 @@ class capitalDivisionAsker : public boxAsker
capitalDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count);
protected:
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer);
void setAnswerHook(int userSays);
QString getQuestionHook() const;
division::askMode askMode() const { return division::eCapital; }
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) Q_DECL_OVERRIDE;
void setAnswerHook(int userSays) Q_DECL_OVERRIDE;
QString getQuestionHook() const Q_DECL_OVERRIDE;
division::askMode askMode() const Q_DECL_OVERRIDE { return division::eCapital; }
private:
QString p_capital;
......
......@@ -19,10 +19,10 @@ class divisionCapitalAsker : public boxAsker
divisionCapitalAsker(QWidget *parent, KGmap *m, QWidget *w, uint count);
protected:
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer);
void setAnswerHook(int userSays);
QString getQuestionHook() const;
division::askMode askMode() const { return division::eCapital; }
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) Q_DECL_OVERRIDE;
void setAnswerHook(int userSays) Q_DECL_OVERRIDE;
QString getQuestionHook() const Q_DECL_OVERRIDE;
division::askMode askMode() const Q_DECL_OVERRIDE { return division::eCapital; }
private:
QString p_capital;
......
......@@ -19,10 +19,10 @@ class divisionFlagAsker : public boxAsker
divisionFlagAsker(QWidget *parent, KGmap *m, QWidget *w, uint count);
protected:
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer);
void setAnswerHook(int userSays);
QString getQuestionHook() const;
division::askMode askMode() const { return division::eFlag; }
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) Q_DECL_OVERRIDE;
void setAnswerHook(int userSays) Q_DECL_OVERRIDE;
QString getQuestionHook() const Q_DECL_OVERRIDE;
division::askMode askMode() const Q_DECL_OVERRIDE { return division::eFlag; }
};
#endif
......@@ -29,7 +29,7 @@ class flagWidget : public QWidget
QImage img;
protected:
void paintEvent(QPaintEvent *)
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE
{
QPainter p(this);
p.drawImage((width() - img.width()) / 2, 0, img);
......
......@@ -21,10 +21,10 @@ class flagDivisionAsker : public boxAsker
flagDivisionAsker(QWidget *parent, KGmap *m, QWidget *w, uint count);
protected:
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer);
void setAnswerHook(int userSays);
QString getQuestionHook() const;
division::askMode askMode() const { return division::eFlag; }
bool nextBoxAskerQuestionHook(const QString &division, int i, bool isAnswer) Q_DECL_OVERRIDE;
void setAnswerHook(int userSays) Q_DECL_OVERRIDE;
QString getQuestionHook() const Q_DECL_OVERRIDE;
division::askMode askMode() const Q_DECL_OVERRIDE { return division::eFlag; }
private:
flagWidget *p_flag;
......
......@@ -30,7 +30,7 @@ Q_OBJECT
~kgeography();
protected:
void showEvent(QShowEvent *e);
void showEvent(QShowEvent *e) Q_DECL_OVERRIDE;
private slots:
void openMap();
......
......@@ -31,17 +31,17 @@ Q_OBJECT
bool isAsker() const;
protected:
void nextQuestionHook(const QString &division);
void mousePressEvent(QMouseEvent *e);
QString getQuestionHook() const;
void showEvent(QShowEvent *e);
division::askMode askMode() const { return division::eClick; }
void nextQuestionHook(const QString &division) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
QString getQuestionHook() const Q_DECL_OVERRIDE;
void showEvent(QShowEvent *e) Q_DECL_OVERRIDE;
division::askMode askMode() const Q_DECL_OVERRIDE { return division::eClick; }
public slots:
void setMovement(bool b);
void setZoom(bool b);
void setOriginalZoom();
void setAutomaticZoom(bool b);
void setMovement(bool b) Q_DECL_OVERRIDE;
void setZoom(bool b) Q_DECL_OVERRIDE;
void setOriginalZoom() Q_DECL_OVERRIDE;
void setAutomaticZoom(bool b) Q_DECL_OVERRIDE;
private slots:
void handleMapClick(QRgb c, const QPoint &p);
......
......@@ -42,11 +42,11 @@ Q_OBJECT
void clicked(QRgb, const QPoint&);
protected:
void mousePressEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void wheelEvent(QWheelEvent *e);
void resizeEvent(QResizeEvent *e);
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
private:
/**
......
......@@ -27,8 +27,8 @@ Q_OBJECT
void deleteMe();
protected:
void mousePressEvent(QMouseEvent *);
bool eventFilter(QObject *obj, QEvent *ev);
void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE;
private:
QString wikipedia;
......
......@@ -33,16 +33,16 @@ Q_OBJECT
bool isAsker() const;
protected:
void nextQuestionHook(const QString &division);
void mousePressEvent(QMouseEvent *e);
QString getQuestionHook() const;
division::askMode askMode() const { return division::eClick; }
void nextQuestionHook(const QString &division) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
QString getQuestionHook() const Q_DECL_OVERRIDE;
division::askMode askMode() const Q_DECL_OVERRIDE { return division::eClick; }
public slots:
void setMovement(bool b);
void setZoom(bool b);
void setOriginalZoom();
void setAutomaticZoom(bool b);
void setMovement(bool b) Q_DECL_OVERRIDE;
void setZoom(bool b) Q_DECL_OVERRIDE;
void setOriginalZoom() Q_DECL_OVERRIDE;
void setAutomaticZoom(bool b) Q_DECL_OVERRIDE;
private slots:
void handleMapClick(QRgb c, const QPoint &, const QPointF &mapPoint);
......
......@@ -50,13 +50,13 @@ Q_OBJECT
void clicked(QRgb, const QPoint&, const QPointF &);
protected:
void mousePressEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
void wheelEvent(QWheelEvent *e);
void resizeEvent(QResizeEvent *e);
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void enterEvent(QEvent *e) Q_DECL_OVERRIDE;
void leaveEvent(QEvent *e) Q_DECL_OVERRIDE;
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
void createGameMapImage();
void updateCursor();
......
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