代码拉取完成,页面将自动刷新
#ifndef TASKTIMER_H
#define TASKTIMER_H
#include <QObject>
#include <QLCDNumber>
#include <QTimer>
#include <QLabel>
#include "taskitem.h"
#include <QSoundEffect>
#include <QApplication>
#include <QPushButton>
using timeVec = QPair<QTime, QTime>;
using timeVecs = QVector<timeVec>;
class taskTimer : public QObject
{
Q_OBJECT
private:
QLabel *m_today_count_total;
QLCDNumber *m_lcdNumber;
QTimer *m_timer;
QLabel *m_state_label;
QPushButton *m_start_btn;
QPushButton *m_stop_btn;
int m_counts = 0; //时间计数
// 计时器到期提示音
QSoundEffect *m_timer_end_effect;
bool m_time_vec_flag=false;
timeVecs m_time_vecs;
timeVec m_time_vec;
public:
enum taskState {WORK, REST};
taskState m_task_state;
public:
explicit taskTimer(QObject *parent = nullptr);
explicit taskTimer(QLabel *today_count_total, QLCDNumber *lcdNumber, QTimer *timer, QLabel *state_label, QPushButton *startBtn, QPushButton *stopBtn, QObject *parent = nullptr);
bool isActivate();
void lcdDisplay(int count);
void resetCount();
void stateSwitch();
void Init();
void TaskStart();
void TaskPause();
void TaskReset();
void TaskEnd();
void timerTick();
void bellPlay();
signals:
void SendTaskEndSignal(timeVecs *ptime_vecs);
};
#endif // TASKTIMER_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。