当前位置: 首页>>代码示例>>C++>>正文


C++ QThread::disconnect方法代码示例

本文整理汇总了C++中QThread::disconnect方法的典型用法代码示例。如果您正苦于以下问题:C++ QThread::disconnect方法的具体用法?C++ QThread::disconnect怎么用?C++ QThread::disconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QThread的用法示例。


在下文中一共展示了QThread::disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: calibrateVolume

void TSController::calibrateVolume(){
    QSettings settings("settings.ini",QSettings::IniFormat);
    QDialog d(this);
    Ui::TSProgressDialog dui;
    //d.setWindowFlags(Qt::SubWindow);
    dui.setupUi(&d);

    //controller->setWindowFlags(Qt::WindowTitleHint | Qt::WindowMinimizeButtonHint|Qt::SubWindow);
    d.setWindowTitle(tr("Предупреждение"));
    dui.information->setText(tr("Идет подготовка..."));
    dui.acceptButton->setVisible(false);

    TSUsbDataReader *reader = new TSUsbDataReader();
    QThread *thread = new QThread();
    connect(thread,SIGNAL(started()),reader,SLOT(doWork()));
    connect(reader,SIGNAL(done()),&d,SLOT(accept()));
    connect(reader,SIGNAL(changeProgress(int)),dui.progressBar,SLOT(setValue(int)));
    reader->setBuffer(curveBuffer);
    reader->setReadingType(ReadForVolZer);
    reader->moveToThread(thread);
    thread->start();


    /*connect(readerThread,SIGNAL(done()),&d,SLOT(accept()));
    connect(readerThread,SIGNAL(changeProgress(int)),dui.progressBar,SLOT(setValue(int)));
    readerThread->setReadingType(ReadForVolZer);
    readerThread->startRead();*/
    if(d.exec()==1){
        settings.setValue("volZero",curveBuffer->volumeColibration());
        dui.information->setText(tr("Подготовка завершена.\nНажмите ОК и качайте шприцем."));
        dui.progressBar->setVisible(false);
        dui.acceptButton->setVisible(true);
    }
    reader->stopRead();
    Sleep(200);
    thread->quit();
    Sleep(200);
    thread->disconnect(reader);
    disconnect(&d,SLOT(accept()));
    delete thread;
    thread = NULL;
    delete reader;
    reader=NULL;

    d.exec();
    connect(&cPlotingTimer,SIGNAL(timeout()),this,SLOT(plotCalibration()));


    _reader = new TSUsbDataReader();
    _thread = new QThread();
    connect(_thread,SIGNAL(started()),_reader,SLOT(doWork()));
    connect(_reader,SIGNAL(done()),&d,SLOT(accept()));
    connect(_reader,SIGNAL(changeProgress(int)),dui.progressBar,SLOT(setValue(int)));
    _reader->setBuffer(curveBuffer);
    _reader->setReadingType(ReadForVolVal);
    _reader->moveToThread(_thread);
    _thread->start();
    cPlotingTimer.start(100);
}
开发者ID:Zaher220,项目名称:Termospiro,代码行数:59,代码来源:tscontroller.cpp


注:本文中的QThread::disconnect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。