qtimer

How to run a timer inside a QThread?

风流意气都作罢 提交于 2019-11-30 07:36:23
I would like to run a timer inside a QThread. I have written some code in which i am getting some error during the run time. Please guide me into the right direction. What am I doing wrong? (Parent is QThread(0x1498d10), parent's thread is QThread(0x11272b0), current thread is QThread(0x1498d10) mainwindow.h //main .h file #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "mythread.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); MyThread *myt; private: Ui::MainWindow