Commit 895cb1cc authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

0 -> nullptr

parent 2f95e655
......@@ -34,7 +34,7 @@ public:
* @param newHeight the number of squares tall the board is
* @param parent passed to QGraphicsScene's constructor
*/
GameBoardScene(int newWidth, int newHeight, QObject *parent = 0);
GameBoardScene(int newWidth, int newHeight, QObject *parent = nullptr);
///Destructor
~GameBoardScene();
/**
......
......@@ -15,7 +15,7 @@ GameBoardView::GameBoardView(QWidget *parent) : QGraphicsView(parent)
void GameBoardView::setBoardSize()
{
if (scene() != 0) {
if (scene() != nullptr) {
fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);
}
}
......
......@@ -32,13 +32,13 @@ public:
*
* @param parent the parent of the widget
*/
explicit GameBoardView(QWidget *parent = 0);
explicit GameBoardView(QWidget *parent = nullptr);
/**
* Asks the scene through ( qobject_cast<GameBoardScene*>(scene()) ) for the smallest size it should be
*/
QSize minimumSizeHint() const Q_DECL_OVERRIDE
{
if (scene() == 0) {
if (scene() == nullptr) {
return QSize();
} else {
return qobject_cast<GameBoardScene *>(scene())->minimumSizeHint();
......@@ -51,7 +51,7 @@ protected:
///Overloaded to resize board.
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE
{
if (scene() != 0) {
if (scene() != nullptr) {
fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);
} QGraphicsView::resizeEvent(event);
}
......
......@@ -25,7 +25,7 @@
#include "aicontroller.h"
#include "gameboardview.h"
KSquaresDemoWindow::KSquaresDemoWindow() : KXmlGuiWindow(), m_view(new GameBoardView(this)), m_scene(0)
KSquaresDemoWindow::KSquaresDemoWindow() : KXmlGuiWindow(), m_view(new GameBoardView(this)), m_scene(nullptr)
{
sGame = new KSquaresGame();
connect(sGame, &KSquaresGame::takeTurnSig, this, &KSquaresDemoWindow::playerTakeTurn);
......
......@@ -36,7 +36,7 @@
#include "newgamedialog.h"
#include "scoresdialog.h"
KSquaresWindow::KSquaresWindow() : KXmlGuiWindow(), m_view(new GameBoardView(this)), m_scene(0)
KSquaresWindow::KSquaresWindow() : KXmlGuiWindow(), m_view(new GameBoardView(this)), m_scene(nullptr)
{
setCentralWidget(m_view);
QTimer::singleShot(0, this, &KSquaresWindow::initObject);
......
......@@ -18,7 +18,7 @@ class NewGameDialog : public QDialog, public Ui::NewGameWidget
{
Q_OBJECT
public:
explicit NewGameDialog(QWidget *parent = 0);
explicit NewGameDialog(QWidget *parent = nullptr);
public Q_SLOTS:
void adjustEnabledUsers(int);
......
......@@ -17,7 +17,7 @@
class ScoresDialog : public QDialog, public Ui::ScoresWidget
{
public:
explicit ScoresDialog(QWidget *parent = 0);
explicit ScoresDialog(QWidget *parent = nullptr);
};
#endif // SCORESDIALOG_H
......@@ -21,10 +21,10 @@
class KSquaresSquareItem : public QGraphicsRectItem
{
public:
explicit KSquaresSquareItem(QGraphicsItem *parent = 0);
explicit KSquaresSquareItem(QGraphicsItem *parent = nullptr);
~KSquaresSquareItem();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) Q_DECL_OVERRIDE;
};
#endif // THEMEGRAPHICSITEMS_H
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