Use C++11 override and nullptr

This commit is contained in:
Jeffrey Pfau 2014-02-02 01:42:36 -08:00
parent 6341172813
commit 3b7dbdecba
5 changed files with 12 additions and 12 deletions

View File

@ -16,7 +16,7 @@ class AudioThread : public QThread {
Q_OBJECT
public:
AudioThread(QObject* parent = 0);
AudioThread(QObject* parent = nullptr);
void setInput(GBAAudio* input);
@ -35,13 +35,13 @@ class AudioDevice : public QIODevice {
Q_OBJECT
public:
AudioDevice(GBAAudio* audio, QObject* parent = 0);
AudioDevice(GBAAudio* audio, QObject* parent = nullptr);
void setFormat(const QAudioFormat& format);
protected:
virtual qint64 readData(char* data, qint64 maxSize);
virtual qint64 writeData(const char* data, qint64 maxSize);
virtual qint64 readData(char* data, qint64 maxSize) override;
virtual qint64 writeData(const char* data, qint64 maxSize) override;
private:
GBAAudio* m_audio;

View File

@ -14,15 +14,15 @@ class Display : public QGLWidget {
Q_OBJECT
public:
Display(QWidget* parent = 0);
Display(QWidget* parent = nullptr);
public slots:
void startDrawing(const uint32_t* buffer, GBAThread* context);
void stopDrawing();
protected:
virtual void paintEvent(QPaintEvent*) {};
virtual void resizeEvent(QResizeEvent*);
virtual void paintEvent(QPaintEvent*) override {};
virtual void resizeEvent(QResizeEvent*) override;
private:
Painter* m_painter;

View File

@ -10,7 +10,7 @@ using namespace QGBA;
GameController::GameController(QObject* parent)
: QObject(parent)
, m_drawContext(new uint32_t[256 * 256])
, m_audioContext(0)
, m_audioContext(nullptr)
{
m_renderer = new GBAVideoSoftwareRenderer;
GBAVideoSoftwareRendererCreate(m_renderer);

View File

@ -22,7 +22,7 @@ class GameController : public QObject {
Q_OBJECT
public:
GameController(QObject* parent = 0);
GameController(QObject* parent = nullptr);
~GameController();
const uint32_t* drawContext() const { return m_drawContext; }

View File

@ -19,7 +19,7 @@ class Window : public QMainWindow {
Q_OBJECT
public:
Window(QWidget* parent = 0);
Window(QWidget* parent = nullptr);
static GBAKey mapKey(int qtKey);
signals:
@ -34,8 +34,8 @@ public slots:
#endif
protected:
virtual void keyPressEvent(QKeyEvent* event);
virtual void keyReleaseEvent(QKeyEvent* event);
virtual void keyPressEvent(QKeyEvent* event) override;
virtual void keyReleaseEvent(QKeyEvent* event) override;
virtual void closeEvent(QCloseEvent*) override;
private slots: