/*! * * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file MainTimer.h * \author (last) Behrouz NematiPour * \date (last) 18-Jul-2023 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * */ #pragma once // Qt #include // Project #include "main.h" // Doxygen : do not remove // Define #define _MainTimer MainTimer::I() /*! * \brief The MainTimer class * \details This class is going to be used for subjects which want to keep track of time to a second resolution. */ class MainTimer : public QObject { Q_OBJECT // Singleton SINGLETON(MainTimer) static const int _interval = 1000; //ms void initConnections(); public: bool init(); void quit(); private: bool isDateChanged(bool vIncludeTime = false); private slots: void onCheckInBegin(); signals: void didTimeout(); void didDateChange(); protected: void timerEvent(QTimerEvent *) override; };