Qt线程测试

Qt线程测试

#include "vcmainthread.h"
 
VCMainThread::VCMainThread(QWidget *parent)
    : QMainWindow(parent)
{
    ui.setupUi(this);
    videoThread1 = new VideoThread();
 
    connect(videoThread1, SIGNAL(DisplaySignal(QString)), this, SLOT(DisplayLog(QString)));
}
 
void VCMainThread::DisplayLog(QString str)
{
    ui.logDisplay->setText(str);
}
 
void VCMainThread::OnStartVideoButtonClick()
{
    if (videoThread1 != nullptr)
    {
        videoThread1->start();
    }
}

 

 

###########

posted @ 2023-01-04 16:37  西北逍遥  阅读(31)  评论(0编辑  收藏  举报