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

Use Q_DECLARE_OVERRIDE

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