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

View File

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

View File

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

View File

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

View File

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