1 Star 4 Fork 0

Zz_er/transaction_manager

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tasktimer.h 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
Zz_er 提交于 2022-07-05 12:14 . version 1.1.2
#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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/zz_er/transaction_manager.git
git@gitee.com:zz_er/transaction_manager.git
zz_er
transaction_manager
transaction_manager
master

搜索帮助