Commit 627e2b37 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECLARE_OVERRIDE

parent 4507f8fe
......@@ -83,7 +83,7 @@ class GameScene : public QGraphicsScene
void redoAllMove();
protected:
/** Reimplemented for drawing the background depending on the settings */
virtual void drawBackground( QPainter* painter, const QRectF& rect );
void drawBackground( QPainter* painter, const QRectF& rect ) Q_DECL_OVERRIDE;
private Q_SLOTS:
/** Check whether the player has no way to remove any pieces, emit signals if finished */
void checkGameFinished();
......
......@@ -35,7 +35,7 @@ class GameView : public QGraphicsView
explicit GameView( QGraphicsScene* scene, QWidget* parent = 0 );
protected:
/** Reimplemented for notifying game scene of the resize event */
virtual void resizeEvent( QResizeEvent *event );
void resizeEvent( QResizeEvent *event ) Q_DECL_OVERRIDE;
};
#endif // GAMEVIEW_H
......@@ -36,7 +36,7 @@ class Piece : public KGameRenderedObjectItem
/** Destructor */
~Piece();
/** Reimplemented for using bounding rect for detecting hovering and mouse clicking */
virtual QPainterPath shape() const;
QPainterPath shape() const Q_DECL_OVERRIDE;
/** The current column in the game scene, from left to right, starts from 0 */
int m_x;
/** The current row in the game scene, from top to bottom, starts from 0 */
......@@ -58,11 +58,11 @@ class Piece : public KGameRenderedObjectItem
void pieceUnhovered( int x, int y );
protected:
/** Reimplemented for emitting signals if this piece is hovered */
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent* event );
void hoverEnterEvent( QGraphicsSceneHoverEvent* event ) Q_DECL_OVERRIDE;
/** Reimplemented for emitting signals if this piece is unhovered */
virtual void hoverLeaveEvent( QGraphicsSceneHoverEvent* event );
void hoverLeaveEvent( QGraphicsSceneHoverEvent* event ) Q_DECL_OVERRIDE;
/** Reimplemented for emitting signals if any mouse click event */
virtual void mousePressEvent( QGraphicsSceneMouseEvent* event );
void mousePressEvent( QGraphicsSceneMouseEvent* event ) Q_DECL_OVERRIDE;
};
#endif // PIECE_H
......@@ -33,14 +33,14 @@ class HidePiece : public QUndoCommand
explicit HidePiece( Piece* piece ) : m_piece(piece) {
setText( QStringLiteral( "Hide Piece" ) );
}
virtual int id() const {
int id() const Q_DECL_OVERRIDE {
return ID_HIDEPIECE;
}
virtual void undo() {
void undo() Q_DECL_OVERRIDE {
m_piece->setEnabled( true );
m_piece->show();
}
virtual void redo() {
void redo() Q_DECL_OVERRIDE {
m_piece->setEnabled( false );
m_piece->hide();
}
......@@ -57,13 +57,13 @@ class SwapPiece : public QUndoCommand
: m_pieceA(a), m_pieceB(b), m_posA(posA), m_posB(posB) {
setText( QStringLiteral( "Swap Piece" ) );
}
virtual int id() const {
int id() const Q_DECL_OVERRIDE {
return ID_SWAPPIECE;
}
virtual void undo() {
void undo() Q_DECL_OVERRIDE {
redo();
}
virtual void redo() {
void redo() Q_DECL_OVERRIDE {
Piece* tmpA = *m_pieceA;
Piece* tmpB = *m_pieceB;
int tmpAX = tmpA->m_x;
......
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