struct Thread: public Thread{ explicit Thread(QObject *parent = 0) : QThread(parent) {}protected: void run() { (void)exec(); }};
struct Thread: public QThread{ explicit Thread(QObject *parent = 0) : QThread(parent) {}public: void run() { (void)exec(); }};class frmMain : public QWidget, public Ui::MainWindow{ Q_OBJECT public : frmMain(); ~frmMain(); Thread thread1;}
frmMain::frmMain() : QWidget(0, Qt::Window){ connect(pushButton_6, SIGNAL(clicked()), SLOT(count1())); this->moveToThread(&thread1); connect(&thread1, SIGNAL(started()), this, SLOT(countch())); }void frmMain::count1(){ thread1.start();}void frmMain::countch(){ //вывод данных на экран}
this->moveToThread(&thread1);