From 4523ae742e0b2d018a443a13265106f16b39d0be Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 13 Mar 2014 18:51:14 -0400 Subject: [PATCH] =?UTF-8?q?Tweak=20in=20code=20styling=20per=20Brad?= =?UTF-8?q?=E2=80=99s=20feedback,=20along=20with=20using=20SIGNAL=20and=20?= =?UTF-8?q?SLOT=20instead=20of=20function=20pointers=20directly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interface/src/GLCanvas.cpp | 13 ++++++++----- interface/src/GLCanvas.h | 6 ++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index bf99608c07..249f7a373d 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -13,15 +13,18 @@ #include #include -GLCanvas::GLCanvas() : QGLWidget(QGLFormat(QGL::NoDepthBuffer, QGL::NoStencilBuffer)), _throttleRendering(false), _idleRenderInterval(100) { +GLCanvas::GLCanvas() : QGLWidget(QGLFormat(QGL::NoDepthBuffer, QGL::NoStencilBuffer)), + _throttleRendering(false), + _idleRenderInterval(100) +{ } void GLCanvas::initializeGL() { Application::getInstance()->initializeGL(); setAttribute(Qt::WA_AcceptTouchEvents); setAcceptDrops(true); - connect(Application::getInstance(), &Application::applicationStateChanged, this, &GLCanvas::activeChanged); - connect(&_frameTimer, &QTimer::timeout, this, &GLCanvas::throttleRender); + connect(Application::getInstance(), SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(activeChanged(Qt::ApplicationState))); + connect(&_frameTimer, SIGNAL(timeout()), this, SLOT(throttleRender())); } void GLCanvas::paintGL() { @@ -54,8 +57,8 @@ void GLCanvas::mouseReleaseEvent(QMouseEvent* event) { Application::getInstance()->mouseReleaseEvent(event); } -void GLCanvas::activeChanged() { - switch (Application::applicationState()) { +void GLCanvas::activeChanged(Qt::ApplicationState state) { + switch (state) { case Qt::ApplicationActive: // If we're active, stop the frame timer and the throttle. _frameTimer.stop(); diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index 7e4a4d0334..e6dcc38977 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -14,6 +14,7 @@ /// customized canvas that simply forwards requests/events to the singleton application class GLCanvas : public QGLWidget { + Q_OBJECT public: GLCanvas(); protected: @@ -39,8 +40,9 @@ protected: virtual void dragEnterEvent(QDragEnterEvent *event); virtual void dropEvent(QDropEvent* event); - - void activeChanged(); + +private slots: + void activeChanged(Qt::ApplicationState state); void throttleRender(); };