Commit 831cc091 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECLARE_OVERRIDE

parent 673690b7
......@@ -59,17 +59,17 @@ class ButtonSprite : public PixmapSprite
/** Standard QGI advance function.
* @param phase The advance phase
*/
virtual void advance(int phase);
void advance(int phase) Q_DECL_OVERRIDE;
/** Retrieve the type of QGI. This item is UserType+10
* @return The type of item.
*/
virtual int type() const {return QGraphicsItem::UserType+100;}
int type() const Q_DECL_OVERRIDE {return QGraphicsItem::UserType+100;}
/** Main theme change function. On call of this the item needs to redraw and
* resize.
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/** Store the button text.
* @param s The text
......
......@@ -63,7 +63,7 @@ class DisplayGame : public QObject, public virtual Themeable
/** Main theme function. Called by the theme manager. Redraw and resize
* display.
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/** Set a game piece to a certain position on the game board. If an animation
* is requested the piece 'falls' to this position.
......
......@@ -70,7 +70,7 @@ class DisplayIntro : public QObject, public virtual Themeable
/** Theme change method. The object has to completely redraw
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/* Called from the view event viewportEvent() to handle mouse events.
* NOTE: An own event handler is implemeted because the Qt4.3 QGraphicsView event
......
......@@ -128,12 +128,12 @@ class IntroSprite : public PixmapSprite
/** Standard QGI advance function.
* @param phase The advance phase
*/
virtual void advance(int phase);
void advance(int phase) Q_DECL_OVERRIDE;
/** Retrieve the type of QGI. This item is UserType+1
* @return The type of item.
*/
virtual int type() const {return QGraphicsItem::UserType+1;}
int type() const Q_DECL_OVERRIDE {return QGraphicsItem::UserType+1;}
/** Retrieve the sprite numbers (which introsprite e.g. 0-42)
* @return The sprite numbers.
......@@ -143,7 +143,7 @@ class IntroSprite : public PixmapSprite
/** Main theme notification method. Is called for any theme changes. It must be
* implemented so that the item redraws correctly when the theme changed.
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/** Retrieve the duration of an animation.
* @return The duration [ms]
......
......@@ -150,9 +150,9 @@ public:
* @param g A pointer to your KGame.
* @param p A pointer to the player owning this dialog
**/
virtual void submitToKGame(KGame* g, KPlayer* p);
void submitToKGame(KGame* g, KPlayer* p) Q_DECL_OVERRIDE;
virtual void setKGame(KGame* g);
void setKGame(KGame* g) Q_DECL_OVERRIDE;
/**
* This sets the default port and host used in @ref KGameConnectDialog.
......
......@@ -41,19 +41,19 @@ class KMessageFilePipe : public KMessageIO
public:
KMessageFilePipe(QObject *parent,QFile *readFile,QFile *writeFile);
~KMessageFilePipe();
bool isConnected() const;
void send (const QByteArray &msg);
bool isConnected() const Q_DECL_OVERRIDE;
void send (const QByteArray &msg) Q_DECL_OVERRIDE;
void exec();
/**
@return FALSE as this is no network IO.
*/
bool isNetwork() const { return false; }
bool isNetwork() const Q_DECL_OVERRIDE { return false; }
/**
* The runtime idendifcation
*/
virtual int rtti() const {return 4;}
int rtti() const Q_DECL_OVERRIDE {return 4;}
......
......@@ -209,7 +209,7 @@ public:
return *this;
}
void load(QDataStream& s)
void load(QDataStream& s) Q_DECL_OVERRIDE
{
//qCDebug(KFOURINLINE_LOG) << "KGamePropertyArray load" << id();
type data;
......@@ -223,7 +223,7 @@ public:
emitSignal();
}
}
void save(QDataStream &s)
void save(QDataStream &s) Q_DECL_OVERRIDE
{
//qCDebug(KFOURINLINE_LOG) << "KGamePropertyArray save "<<id();
for (int i=0; i<QVector<type>::size(); i++)
......@@ -232,7 +232,7 @@ public:
}
}
void command(QDataStream &stream,int msgid, bool isSender)
void command(QDataStream &stream,int msgid, bool isSender) Q_DECL_OVERRIDE
{
Q_UNUSED(isSender);
KGamePropertyBase::command(stream, msgid);
......
......@@ -114,7 +114,7 @@ class KWin4App : public KXmlGuiWindow
* to save its state.
* @param grp The config group
*/
virtual void saveProperties(KConfigGroup& grp);
void saveProperties(KConfigGroup& grp) Q_DECL_OVERRIDE;
/** Read the properties of the application.
*/
......@@ -123,11 +123,11 @@ class KWin4App : public KXmlGuiWindow
/** Read instance-specific properties.
* @param grp The config group
*/
virtual void readProperties(const KConfigGroup& grp);
void readProperties(const KConfigGroup& grp) Q_DECL_OVERRIDE;
/** Called by Qt when closing the window
*/
void closeEvent(QCloseEvent *event);
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
/** Retrieve the theme file from the theme index number give.
* @param idx The theme index number [0..]
......
......@@ -74,7 +74,7 @@ class KWin4Doc : public KGame
* @param reset Reset parameter forward to KGame
* @return True on success, false otherwise.
*/
bool loadgame(QDataStream &stream, bool network, bool reset);
bool loadgame(QDataStream &stream, bool network, bool reset) Q_DECL_OVERRIDE;
/** Read the game config from the config file.
* @param config The config
......@@ -199,13 +199,13 @@ class KWin4Doc : public KGame
* @param io The IO mode
* @param isvirtual True for network players (without physical IO)
*/
KPlayer* createPlayer(int rtti, int io, bool isvirtual);
KPlayer* createPlayer(int rtti, int io, bool isvirtual) Q_DECL_OVERRIDE;
/** KGame function to determine the next player. In KWin4 players alternate.
* @param last The last player to move
* @param exclusive unused
*/
KPlayer* nextPlayer(KPlayer* last, bool exclusive=true);
KPlayer* nextPlayer(KPlayer* last, bool exclusive=true) Q_DECL_OVERRIDE;
/** This is also an overwritten function of KGame. It is
* called in the game negotiation upon connect. Here
......@@ -215,7 +215,7 @@ class KWin4Doc : public KGame
* @param newList List of new players
* @param inactive List of inactive players
*/
void newPlayersJoin(KGamePlayerList* list, KGamePlayerList* newList, QList<int>& inactive);
void newPlayersJoin(KGamePlayerList* list, KGamePlayerList* newList, QList<int>& inactive) Q_DECL_OVERRIDE;
/** Reset the whole game to the beginning (clear board, ...)
* @param initview If true also reset the view
......@@ -242,7 +242,7 @@ class KWin4Doc : public KGame
* @param player The current player
* @return -1: remis, 1: won, 0: continue game
*/
int checkGameOver(KPlayer *player);
int checkGameOver(KPlayer *player) Q_DECL_OVERRIDE;
/** Check whether the field has a game over situation. Called by
* above standard KGame function but with more suitable parameters.
......@@ -265,7 +265,7 @@ class KWin4Doc : public KGame
* @param msg The game move messasge
* @param player The sender player
*/
bool playerInput(QDataStream& msg, KPlayer* player);
bool playerInput(QDataStream& msg, KPlayer* player) Q_DECL_OVERRIDE;
/** Set the IO devices new.
*/
......
......@@ -51,7 +51,7 @@ class KWin4Player : public KPlayer
* _type_ for kwin4.
* @return The player type = 1.
*/
int rtti() const {return 1;}
int rtti() const Q_DECL_OVERRIDE {return 1;}
/** Assign the score object which allows to display player properties in
* the GUI.
......
......@@ -78,7 +78,7 @@ class KWin4View : public QGraphicsView, public virtual Themeable
* a new theme or a theme size change occurs. This object needs to
* resiez and redraw then.
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/** Initial setup of the game view.
*/
......@@ -177,16 +177,16 @@ class KWin4View : public QGraphicsView, public virtual Themeable
* are resized. Resized and rescale game.
* @param e The resize event
*/
void resizeEvent(QResizeEvent* e);
void resizeEvent(QResizeEvent* e) Q_DECL_OVERRIDE;
/** Widget viewport event.
* @parma event The event.
*/
virtual bool viewportEvent ( QEvent * event ) ;
bool viewportEvent ( QEvent * event ) Q_DECL_OVERRIDE;
/** Overwritten Qt function.
*/
virtual void drawItems(QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[]);
void drawItems(QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[]) Q_DECL_OVERRIDE;
private:
......
......@@ -52,17 +52,17 @@ class PieceSprite : public PixmapSprite
/** Standard QGI advance function.
* @param phase The advance phase
*/
virtual void advance(int phase);
void advance(int phase) Q_DECL_OVERRIDE;
/** Retrieve the type of QGI. This item is UserType+2
* @return The type of item.
*/
virtual int type() const {return QGraphicsItem::UserType+2;}
int type() const Q_DECL_OVERRIDE {return QGraphicsItem::UserType+2;}
/** Standard Themeable function. It is called when the theme item
* needs to completely refresh itself.
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/** Retrieve the sprite notification object. This object indicates the
* end of a movement.
......
......@@ -57,12 +57,12 @@ class PixmapSprite : public QGraphicsPixmapItem, public virtual Themeable
/** Standard QGI advance function.
* @param phase The advance phase
*/
virtual void advance(int phase);
void advance(int phase) Q_DECL_OVERRIDE;
/** Retrieve the type of QGI. This item is UserType+3
* @return The type of item.
*/
virtual int type() const {return QGraphicsItem::UserType+3;}
int type() const Q_DECL_OVERRIDE {return QGraphicsItem::UserType+3;}
/** Retrieve the user defined sprite number (i.e. which PixmapSprite)
* @return The sprite numbers.
......@@ -73,7 +73,7 @@ class PixmapSprite : public QGraphicsPixmapItem, public virtual Themeable
* a new theme or a theme size change occurs. This object needs to
* resiez and redraw then.
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/** Choose a pixmap frame of this sprite. If the setting is forced a
* redraw is even performed when the frame number stays the same. This
......
......@@ -58,11 +58,11 @@ class ReflectionGraphicsScene : public QGraphicsScene
* @param options The draw options
* @param widget The widget
*/
virtual void drawItems(QPainter *painter,
void drawItems(QPainter *painter,
int numItems,
QGraphicsItem *items[],
const QStyleOptionGraphicsItem options[],
QWidget *widget=0);
QWidget *widget=0) Q_DECL_OVERRIDE;
/** Should the background be drawn or not.
* @ param status True to draw the background.
......@@ -75,7 +75,7 @@ class ReflectionGraphicsScene : public QGraphicsScene
* @param painter The painter
* @param rect The clipping rect
*/
void drawBackground ( QPainter * painter, const QRectF & rect );
void drawBackground ( QPainter * painter, const QRectF & rect ) Q_DECL_OVERRIDE;
private:
// Draw background?
......
......@@ -50,17 +50,17 @@ class ScoreSprite : public PixmapSprite
/** Standard QGI advance function.
* @param phase The advance phase
*/
virtual void advance(int phase);
void advance(int phase) Q_DECL_OVERRIDE;
/** Retrieve the type of QGI. This item is UserType+10
* @return The type of item.
*/
virtual int type() const {return QGraphicsItem::UserType+10;}
int type() const Q_DECL_OVERRIDE {return QGraphicsItem::UserType+10;}
/** Main theme change function. On call of this the item needs to redraw and
* resize.
*/
virtual void changeTheme();
void changeTheme() Q_DECL_OVERRIDE;
/** Store the level of the AI.
* @param level The level
......
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