本文整理汇总了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);
}