/*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * \copyright \n * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n * IN PART OR IN WHOLE, \n * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n * * \file maintimer.cpp * \date 2019/09/30 * \author Behrouz NematiPour * */ #include "maintimer.h" //Qt #include //Project // Singleton SINGLETON_INIT(MainTimer) /*! * \brief MainTimer Constructor * \param parent */ MainTimer::MainTimer(QObject *parent) : QObject(parent) { _timer = new QTimer(this); } void MainTimer::init() { connect(_timer, SIGNAL(timeout()), this, SLOT(onTimeout())); connect(_timer, SIGNAL(timeout()), this, SIGNAL(timeout())); _timer->start(_timeout); } void MainTimer::quit() { _timer->stop(); delete _timer; _timer = nullptr; } void MainTimer::onTimeout() { // no op yet }