-
Notifications
You must be signed in to change notification settings - Fork 1
/
mythread.cpp
42 lines (35 loc) · 1.17 KB
/
mythread.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "mythread.h"
//#include <QDebug>
//MyThread::MyThread(QThread *parent) :
// QThread(parent)
//{
//// this->start();
//// this->moveToThread(nullptr);
//// qDebug() << "Thread:\t" << this->thread();
//// this->moveToThread(this);
//// this->moveToThread(this->thread());
// // this->moveToThread(nullptr);
// qDebug() << "Thread:\t" << this->thread();
//// this->start();
//}
//void MyThread::run() {
// threadTimer = new QTimer(this);
// qDebug() << "Timer:\t" << threadTimer->thread();
//// threadTimer->moveToThread(this);
//// qDebug() << "Timer:\t" << threadTimer->thread();
//// connect(this, &MyThread::signalStartTimer, this, &MyThread::slotStartTimer);
// connect(threadTimer, &QTimer::timeout, this, &MyThread::doIt);
//// emit (signalStartTimer());
//// this->moveToThread(this);
// threadTimer->start(1);
// exec();
//}
//void MyThread::doIt() {
// emit (signalStartTimer());
// qDebug() << "It just works";
//}
////void MyThread::slotStartTimer() {
//// threadTimer->start(1);
////}
//int p;
////std::thread([&p](){std::this_thread::sleep_for(std::chrono::milliseconds(10); /*doSOMEJOB*/}).detach();