2 Star 12 Fork 3

1136863240/SimpleEditorByQt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cursorthread.cpp 566 Bytes
一键复制 编辑 原始数据 按行查看 历史
1136863240 提交于 2021-01-03 16:37 . 优化多线程
#include <QDebug>
#include "cursorthread.h"
CursorThread::CursorThread(QObject *parent) : QThread(parent) {
this->is_show = false;
this->is_break = false;
}
void CursorThread::receive_break() {
this->is_break = true;
}
void CursorThread::run() {
while (true) {
if (this->is_break == true) {
break;
}
if (this->is_show == true) {
this->is_show = false;
} else {
this->is_show = true;
}
emit this->send_cursor_status(this->is_show);
this->sleep(1);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/foreverofprogrammer/simple-editor-by-qt.git
git@gitee.com:foreverofprogrammer/simple-editor-by-qt.git
foreverofprogrammer
simple-editor-by-qt
SimpleEditorByQt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385