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

Use Q_DECLARE_OVERRIDE

parent 5311c703
......@@ -101,13 +101,13 @@ signals:
void settingsUpdated();
private slots:
void updateWidgets();
void updateWidgetsDefault();
void updateSettings();
void updateWidgets() Q_DECL_OVERRIDE;
void updateWidgetsDefault() Q_DECL_OVERRIDE;
void updateSettings() Q_DECL_OVERRIDE;
private:
bool hasChanged();
bool isDefault();
bool hasChanged() Q_DECL_OVERRIDE;
bool isDefault() Q_DECL_OVERRIDE;
private:
ConfigSetup* cs;
......
......@@ -67,11 +67,11 @@ signals:
void setStatusText(const QString & str,int id);
protected:
virtual void resizeEvent(QResizeEvent *event);
virtual void timerEvent(QTimerEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
virtual void focusOutEvent (QFocusEvent * /*event*/);
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
void focusOutEvent (QFocusEvent * /*event*/) Q_DECL_OVERRIDE;
bool readSprites();
SConfig modifyConfig(SConfig conf);
void moveShips();
......
......@@ -79,10 +79,10 @@ public:
{ return frames.size(); }
inline QString element(int frame) const
{ return frames.isEmpty() ? QString() : frames.at(frame % frames.size()); }
QPainterPath shape() const;
QPainterPath shape() const Q_DECL_OVERRIDE;
void setAnimation(const QList<QString> &animation);
void advance(int phase);
void advance(int phase) Q_DECL_OVERRIDE;
private:
int currentFrame;
......
......@@ -29,7 +29,7 @@ class SunSprite:public SimpleSprite
{
public:
SunSprite(QSvgRenderer* svg, const QString& element);
virtual int type() const {return S_SUN;}
int type() const Q_DECL_OVERRIDE {return S_SUN;}
};
class PowerupSprite:public SimpleSprite
......@@ -38,7 +38,7 @@ public:
enum {PowerupMine=0, PowerupBullet, PowerupShield, PowerupEnergy,
PowerupNum};
PowerupSprite(QSvgRenderer* svg, const QString& element, int t, double lifetime);
virtual int type() const {return S_POWERUP;}
int type() const Q_DECL_OVERRIDE {return S_POWERUP;}
double getLifetime() {return time;}
void setLifetime(double t) {time=t;}
......@@ -52,7 +52,7 @@ class ShipSprite:public MobileSprite
{
public:
ShipSprite(QSvgRenderer* svg, const QString& element, int pn);
virtual int type() const {return S_SHIP;}
int type() const Q_DECL_OVERRIDE {return S_SHIP;}
int getHitPoints() {return hitpoints;}
void setHitPoints(int hp) {hitpoints=(hp<0?0:hp);}
double getEnergy() {return energy;}
......@@ -74,8 +74,8 @@ public:
int getMinePowerups() {return minePowerups;}
void setBulletPowerups(int b) {bulletPowerups=b;}
int getBulletPowerups() {return bulletPowerups;}
virtual void forward(double mult);
virtual void forward(double mult,int fr);
void forward(double mult) Q_DECL_OVERRIDE;
void forward(double mult,int fr) Q_DECL_OVERRIDE;
virtual void calculateGravityAndEnergy(double gravity,double sunEnergy,
double mult);
private:
......@@ -89,9 +89,9 @@ class BulletSprite:public MobileSprite
{
public:
BulletSprite(QSvgRenderer* svg, const QString& elem, int pn,double lifetime);
virtual int type() const {return S_BULLET;}
virtual void forward(double mult);
virtual void forward(double mult,int fr);
int type() const Q_DECL_OVERRIDE {return S_BULLET;}
void forward(double mult) Q_DECL_OVERRIDE;
void forward(double mult,int fr) Q_DECL_OVERRIDE;
bool timeOut() {return time<=0;}
private:
double time;
......@@ -101,15 +101,15 @@ class MineSprite:public AnimatedSprite
{
public:
MineSprite(QSvgRenderer* svg, const QList<QString> &animation, const QList<QString> &exploanimation, int pn,double atime,double f);
virtual int type() const {return S_MINE;}
int type() const Q_DECL_OVERRIDE {return S_MINE;}
bool isActive() {return active;}
double getFuel() {return fuel;}
void setFuel(double f) {fuel=(f<0.0?0.0:f);}
virtual void forward(double mult);
void forward(double mult) Q_DECL_OVERRIDE;
void explode();
bool explodes() {return expl;}
bool over() {return (expl&&(explosiontime>(timeToGo-0.1)));}
virtual void calculateGravity(double gravity,double mult);
void calculateGravity(double gravity,double mult) Q_DECL_OVERRIDE;
private:
bool expl,active;
double activateTime,fuel,timeToGo,explosiontime;
......@@ -121,9 +121,9 @@ class ExplosionSprite:public AnimatedSprite
{
public:
explicit ExplosionSprite(QSvgRenderer* svg, const QList<QString> &animation, MobileSprite *sp = 0);
virtual int type() const {return S_EXPLOSION;}
int type() const Q_DECL_OVERRIDE {return S_EXPLOSION;}
bool isOver() {return over;}
virtual void forward(double mult);
void forward(double mult) Q_DECL_OVERRIDE;
private:
double timeToGo,time;
bool over;
......
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