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

USe Q_DECL_OVERRIDE

parent d11d277a
......@@ -155,7 +155,7 @@ public:
: DealerInfo(I18N_NOOP("Grandfather's Clock"), GrandfathersClockId)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Clock( this );
}
......
......@@ -45,15 +45,15 @@ class Clock : public DealerScene
public:
explicit Clock( const DealerInfo * di );
virtual void initialize();
void initialize() Q_DECL_OVERRIDE;
protected:
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile* pile, const QList<KCard*> & cards) const;
virtual void restart( const QList<KCard*> & cards );
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile* pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
protected slots:
virtual bool drop();
bool drop() Q_DECL_OVERRIDE;
private:
PatPile* store[8];
......
......@@ -177,7 +177,7 @@ public:
{
}
virtual void run()
void run() Q_DECL_OVERRIDE
{
Solver::ExitStatus result = m_solver->patsolve();
emit finished( result );
......
......@@ -72,7 +72,7 @@ public:
virtual void initialize() = 0;
virtual void relayoutScene();
void relayoutScene() Q_DECL_OVERRIDE;
void updateWonItem();
void addPatPile( PatPile * pile );
......@@ -152,18 +152,18 @@ public slots:
virtual bool tryAutomaticMove( KCard * card );
protected:
virtual bool allowedToAdd(const KCardPile * pile, const QList<KCard*> & cards) const;
virtual bool allowedToRemove(const KCardPile * pile, const KCard * card) const;
bool allowedToAdd(const KCardPile * pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
bool allowedToRemove(const KCardPile * pile, const KCard * card) const Q_DECL_OVERRIDE;
virtual bool checkAdd( const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards ) const;
virtual bool checkRemove( const PatPile * pile, const QList<KCard*> & cards ) const;
virtual bool checkPrefering( const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards ) const;
virtual void cardsMoved( const QList<KCard*> & cards, KCardPile * oldPile, KCardPile * newPile );
void cardsMoved( const QList<KCard*> & cards, KCardPile * oldPile, KCardPile * newPile ) Q_DECL_OVERRIDE;
virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent * mouseEvent );
virtual void mousePressEvent( QGraphicsSceneMouseEvent * mouseEvent );
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * mouseEvent );
void mouseDoubleClickEvent( QGraphicsSceneMouseEvent * mouseEvent ) Q_DECL_OVERRIDE;
void mousePressEvent( QGraphicsSceneMouseEvent * mouseEvent ) Q_DECL_OVERRIDE;
void mouseReleaseEvent( QGraphicsSceneMouseEvent * mouseEvent ) Q_DECL_OVERRIDE;
virtual void restart( const QList<KCard*> & cards ) = 0;
......
......@@ -252,7 +252,7 @@ public:
: DealerInfo(I18N_NOOP("Forty & Eight"), FortyAndEightId)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Fortyeight( this );
}
......
......@@ -45,18 +45,18 @@ class Fortyeight : public DealerScene
public:
explicit Fortyeight( const DealerInfo * di );
virtual void initialize();
void initialize() Q_DECL_OVERRIDE;
protected:
virtual void setGameState( const QString & state );
virtual QString getGameState() const;
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile* pile, const QList<KCard*> & cards) const;
virtual void cardsDroppedOnPile( const QList<KCard*> & cards, KCardPile * pile );
virtual void restart( const QList<KCard*> & cards );
void setGameState( const QString & state ) Q_DECL_OVERRIDE;
QString getGameState() const Q_DECL_OVERRIDE;
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile* pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void cardsDroppedOnPile( const QList<KCard*> & cards, KCardPile * pile ) Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
protected slots:
virtual bool newCards();
bool newCards() Q_DECL_OVERRIDE;
private:
bool canPutStore( const KCardPile * pile, const QList<KCard*> &cards ) const;
......
......@@ -268,7 +268,7 @@ public:
: DealerInfo(I18N_NOOP("Freecell"), FreecellId)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Freecell( this );
}
......
......@@ -47,17 +47,17 @@ class Freecell : public DealerScene
public:
explicit Freecell( const DealerInfo * di );
virtual void initialize();
void initialize() Q_DECL_OVERRIDE;
protected:
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const;
virtual void cardsDroppedOnPile( const QList<KCard*> & cards, KCardPile * pile );
virtual void restart( const QList<KCard*> & cards );
virtual QList<MoveHint> getHints();
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void cardsDroppedOnPile( const QList<KCard*> & cards, KCardPile * pile ) Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
QList<MoveHint> getHints() Q_DECL_OVERRIDE;
protected slots:
virtual bool tryAutomaticMove( KCard * c );
bool tryAutomaticMove( KCard * c ) Q_DECL_OVERRIDE;
private:
bool canPutStore( const KCardPile * pile, const QList<KCard*> & cards ) const;
......
......@@ -76,7 +76,7 @@ public:
}
}
virtual QRectF boundingRect() const
QRectF boundingRect() const Q_DECL_OVERRIDE
{
return QRectF( QPointF(), m_size );
}
......@@ -117,19 +117,19 @@ signals:
void hoverChanged( GameSelectionBox * box, bool hovered );
protected:
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event )
void mousePressEvent( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE
{
Q_UNUSED( event )
emit selected( m_gameId );
}
virtual void hoverEnterEvent( QGraphicsSceneHoverEvent * event )
void hoverEnterEvent( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE
{
Q_UNUSED( event )
emit hoverChanged( this, true );
}
virtual void hoverLeaveEvent( QGraphicsSceneHoverEvent * event )
void hoverLeaveEvent( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE
{
Q_UNUSED( event )
emit hoverChanged( this, false );
......@@ -146,7 +146,7 @@ protected:
update();
}
virtual void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 )
void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) Q_DECL_OVERRIDE
{
Q_UNUSED( option )
Q_UNUSED( widget )
......
......@@ -39,7 +39,7 @@ signals:
void gameSelected( int i );
protected:
virtual void keyReleaseEvent( QKeyEvent * event );
void keyReleaseEvent( QKeyEvent * event ) Q_DECL_OVERRIDE;
private slots:
void boxHoverChanged( GameSelectionBox * box, bool hovered );
......
......@@ -177,7 +177,7 @@ public:
: DealerInfo(I18N_NOOP("Golf"), GolfId)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Golf( this );
}
......
......@@ -45,17 +45,17 @@ class Golf : public DealerScene
public:
explicit Golf( const DealerInfo * di );
virtual void initialize();
void initialize() Q_DECL_OVERRIDE;
protected:
virtual void setGameState( const QString & state );
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const;
virtual void restart( const QList<KCard*> & cards );
virtual bool drop();
void setGameState( const QString & state ) Q_DECL_OVERRIDE;
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
bool drop() Q_DECL_OVERRIDE;
protected slots:
virtual bool newCards();
bool newCards() Q_DECL_OVERRIDE;
private:
PatPile* talon;
......
......@@ -200,7 +200,7 @@ public:
: DealerInfo(I18N_NOOP("Grandfather"), GrandfatherId)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Grandf( this );
}
......
......@@ -47,17 +47,17 @@ class Grandf : public DealerScene
public:
explicit Grandf( const DealerInfo * di );
virtual void initialize();
void initialize() Q_DECL_OVERRIDE;
protected:
virtual void setGameState( const QString & state );
virtual QString getGameState() const;
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const;
virtual void restart( const QList<KCard*> & cards );
void setGameState( const QString & state ) Q_DECL_OVERRIDE;
QString getGameState() const Q_DECL_OVERRIDE;
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
protected slots:
virtual bool newCards();
bool newCards() Q_DECL_OVERRIDE;
private:
void deal( const QList<KCard*> & cardsToDeal );
......
......@@ -177,7 +177,7 @@ public:
: DealerInfo(I18N_NOOP("Gypsy"), GypsyId)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Gypsy( this );
}
......
......@@ -45,16 +45,16 @@ class Gypsy : public DealerScene
public:
explicit Gypsy( const DealerInfo * di );
virtual void initialize();
void initialize() Q_DECL_OVERRIDE;
protected:
virtual void setGameState( const QString & state );
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const;
virtual void restart( const QList<KCard*> & cards );
void setGameState( const QString & state ) Q_DECL_OVERRIDE;
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
protected slots:
virtual bool newCards();
bool newCards() Q_DECL_OVERRIDE;
private:
PatPile* talon;
......
......@@ -259,7 +259,7 @@ public:
: DealerInfo(I18N_NOOP("Aces Up"), AcesUpId)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Idiot( this );
}
......
......@@ -46,19 +46,19 @@ class Idiot: public DealerScene
public:
explicit Idiot( const DealerInfo * di );
virtual void initialize();
virtual bool isGameWon() const;
void initialize() Q_DECL_OVERRIDE;
bool isGameWon() const Q_DECL_OVERRIDE;
protected:
virtual void setGameState( const QString & state );
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const;
virtual void restart( const QList<KCard*> & cards );
virtual bool drop();
void setGameState( const QString & state ) Q_DECL_OVERRIDE;
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
bool drop() Q_DECL_OVERRIDE;
protected slots:
virtual bool newCards();
virtual bool tryAutomaticMove( KCard * card );
bool newCards() Q_DECL_OVERRIDE;
bool tryAutomaticMove( KCard * card ) Q_DECL_OVERRIDE;
private:
void dealRow();
......
......@@ -351,7 +351,7 @@ public:
addSubtype( KlondikeDrawThreeId, I18N_NOOP( "Klondike (Draw 3)" ) );
}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Klondike( this );
}
......
......@@ -49,23 +49,23 @@ class Klondike : public DealerScene
public:
explicit Klondike( const DealerInfo * di );
virtual void initialize();
virtual void mapOldId(int id);
virtual int oldId() const;
QList<QAction*> configActions() const;
void initialize() Q_DECL_OVERRIDE;
void mapOldId(int id) Q_DECL_OVERRIDE;
int oldId() const Q_DECL_OVERRIDE;
QList<QAction*> configActions() const Q_DECL_OVERRIDE;
protected:
virtual void setGameState( const QString & state );
virtual QString getGameOptions() const;
virtual void setGameOptions( const QString & options );
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
virtual bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const;
virtual void cardsMoved( const QList<KCard*> & cards, KCardPile * oldPile, KCardPile * newPile );
virtual void restart( const QList<KCard*> & cards );
void setGameState( const QString & state ) Q_DECL_OVERRIDE;
QString getGameOptions() const Q_DECL_OVERRIDE;
void setGameOptions( const QString & options ) Q_DECL_OVERRIDE;
bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const Q_DECL_OVERRIDE;
bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const Q_DECL_OVERRIDE;
void cardsMoved( const QList<KCard*> & cards, KCardPile * oldPile, KCardPile * newPile ) Q_DECL_OVERRIDE;
void restart( const QList<KCard*> & cards ) Q_DECL_OVERRIDE;
protected slots:
virtual bool drop();
virtual bool newCards();
bool drop() Q_DECL_OVERRIDE;
bool newCards() Q_DECL_OVERRIDE;
private slots:
void gameTypeChanged();
......@@ -94,7 +94,7 @@ public:
KlondikePile( DealerScene * scene, int index, const QString & objectName = QString() );
void setCardsToShow( int numCards );
int cardsToShow() const;
virtual QList<QPointF> cardPositions() const;
QList<QPointF> cardPositions() const Q_DECL_OVERRIDE;
private:
int m_cardsToShow;
......
......@@ -41,7 +41,7 @@ class RenderingThread : public QThread
public:
RenderingThread( KAbstractCardDeckPrivate * d, QSize size, const QStringList & elements );
void run();
void run() Q_DECL_OVERRIDE;
void halt();
Q_SIGNALS:
......
......@@ -37,9 +37,9 @@ private:
public:
enum { Type = QGraphicsItem::UserType + 1 };
virtual int type() const;
int type() const Q_DECL_OVERRIDE;
virtual void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) Q_DECL_OVERRIDE;
quint32 id() const;
int rank() const;
......
......@@ -32,8 +32,8 @@ class KCardAnimation : public QAbstractAnimation
{
public:
KCardAnimation( KCardPrivate * d, int duration, QPointF pos, qreal rotation, bool faceUp );
int duration() const;
void updateCurrentTime( int msec );
int duration() const Q_DECL_OVERRIDE;
void updateCurrentTime( int msec ) Q_DECL_OVERRIDE;
private:
KCardPrivate * d;
......
......@@ -67,12 +67,12 @@ public:
explicit KCardDeck( const KCardTheme & theme = KCardTheme(), QObject * parent = 0 );
virtual ~KCardDeck();
virtual int rankFromId( quint32 id ) const;
virtual int suitFromId( quint32 id ) const;
virtual int colorFromId( quint32 id ) const;
int rankFromId( quint32 id ) const Q_DECL_OVERRIDE;
int suitFromId( quint32 id ) const Q_DECL_OVERRIDE;
int colorFromId( quint32 id ) const Q_DECL_OVERRIDE;
protected:
virtual QString elementName( quint32 id, bool faceUp = true ) const;
QString elementName( quint32 id, bool faceUp = true ) const Q_DECL_OVERRIDE;
private:
class KStandardCardDeckPrivate * const d;
......
......@@ -55,10 +55,10 @@ public:
virtual ~KCardPile();
enum { Type = QGraphicsItem::UserType + 2 };
virtual int type() const;
int type() const Q_DECL_OVERRIDE;
virtual QRectF boundingRect() const;
virtual void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
QRectF boundingRect() const Q_DECL_OVERRIDE;
void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) Q_DECL_OVERRIDE;
QList<KCard*> cards() const;
int count() const;
......
......@@ -136,13 +136,13 @@ protected:
virtual void cardsDroppedOnPile( const QList<KCard*> & cards, KCardPile * pile );
virtual void cardsMoved( const QList<KCard*> & cards, KCardPile * oldPile, KCardPile * newPile );
virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent * e );
virtual void mouseMoveEvent( QGraphicsSceneMouseEvent * e );
virtual void mousePressEvent( QGraphicsSceneMouseEvent * e );
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * e );
virtual void wheelEvent( QGraphicsSceneWheelEvent * e );
void mouseDoubleClickEvent( QGraphicsSceneMouseEvent * e ) Q_DECL_OVERRIDE;
void mouseMoveEvent( QGraphicsSceneMouseEvent * e ) Q_DECL_OVERRIDE;
void mousePressEvent( QGraphicsSceneMouseEvent * e ) Q_DECL_OVERRIDE;
void mouseReleaseEvent( QGraphicsSceneMouseEvent * e ) Q_DECL_OVERRIDE;
void wheelEvent( QGraphicsSceneWheelEvent * e ) Q_DECL_OVERRIDE;
virtual void drawForeground( QPainter * painter, const QRectF & rect );
void drawForeground( QPainter * painter, const QRectF & rect ) Q_DECL_OVERRIDE;
private:
friend class KCardScenePrivate;
......
......@@ -42,7 +42,7 @@ class PreviewThread : public QThread
public:
PreviewThread( const KCardThemeWidgetPrivate * d, const QList<KCardTheme> & themes );
void run();
void run() Q_DECL_OVERRIDE;
void halt();
Q_SIGNALS:
......@@ -67,8 +67,8 @@ public:
void reload();
QModelIndex indexOf( const QString & dirName ) const;
virtual int rowCount( const QModelIndex & parent = QModelIndex() ) const;
virtual QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
int rowCount( const QModelIndex & parent = QModelIndex() ) const Q_DECL_OVERRIDE;
QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE;
private Q_SLOTS:
void deleteThread();
......@@ -87,8 +87,8 @@ class CardThemeDelegate : public QAbstractItemDelegate
public:
explicit CardThemeDelegate( KCardThemeWidgetPrivate * d, QObject * parent = 0 );
virtual void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
virtual QSize sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const Q_DECL_OVERRIDE;
QSize sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const Q_DECL_OVERRIDE;
private:
const KCardThemeWidgetPrivate * const d;
......
......@@ -104,8 +104,8 @@ protected slots:
void slotUpdateMoves(int moves);
protected:
virtual void closeEvent(QCloseEvent * e);
virtual void saveNewToolbarConfig();
void closeEvent(QCloseEvent * e) Q_DECL_OVERRIDE;
void saveNewToolbarConfig() Q_DECL_OVERRIDE;
private slots:
void slotSnapshot();
......
......@@ -34,7 +34,7 @@ public:
void setSize( const QSize & size );
QSize size() const;
virtual void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget );
void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ) Q_DECL_OVERRIDE;
private:
QString m_message;
......
......@@ -238,7 +238,7 @@ public:
: DealerInfo(I18N_NOOP("Mod3"), Mod3Id)
{}
virtual DealerScene *createGame() const
DealerScene *createGame() const Q_DECL_OVERRIDE
{
return new Mod3( this );
}
......
......@@ -46,17 +46,17 @@ class Mod3 : public DealerScene
public:
explicit Mod3( const DealerInfo * di );
virtual void initialize();
void initialize() Q_DECL_OVERRIDE;
protected:
virtual void setGameState( const QString & state );
virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;