Index: sources/maintimer.h =================================================================== diff -u -r781e62c996e81897517fbdb1bc79fe3bbcf165c1 -r0a2ca0373a422201d5316df8fb891ef38799e3f9 --- sources/maintimer.h (.../maintimer.h) (revision 781e62c996e81897517fbdb1bc79fe3bbcf165c1) +++ sources/maintimer.h (.../maintimer.h) (revision 0a2ca0373a422201d5316df8fb891ef38799e3f9) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 @@ -22,9 +22,6 @@ // Define #define _MainTimer MainTimer::I() -// Forward declaration -class QTimer; - /*! * \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. @@ -33,17 +30,20 @@ { Q_OBJECT - static const int _timeout = 1000; //ms - QTimer *_timer = nullptr; + static const int _interval = 1000; //ms -SINGLETON_DECL(MainTimer) +// Singleton +SINGLETON(MainTimer) public: - void init(); + bool init(); void quit(); +private: + bool isDateChanged(bool vIncludeTime = true); signals: - void timeout(); + void didTimeout(); + void didDateChange(); -private slots: - void onTimeout(); +protected: + void timerEvent(QTimerEvent *) override; };