本文整理汇总了C++中MyThread::quit方法的典型用法代码示例。如果您正苦于以下问题:C++ MyThread::quit方法的具体用法?C++ MyThread::quit怎么用?C++ MyThread::quit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyThread
的用法示例。
在下文中一共展示了MyThread::quit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start
/*******************************************************************88
Start the Process of Adding a new Database
Start the timer, change cursor,
Find out if we can create the database using the selected name
If we can create the database then we change to the Progress Page
Then start Database->setupDatabase process.
**********************************************************************/
void SetupPage::start()
{
timeSeconds_ = 0;
MyThread* myThread = new MyThread(this);
myThread->start();
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
addDatabase_->timer_ = new Timer; // Start timer
bool recursive = false;
if (recursiveDirCheckBox->checkState() == Qt::Checked) {
recursive = true;
}
bool eraseDuplicates = false;
if (acceptDuplicatesCheckBox->checkState() == Qt::Checked) {
eraseDuplicates = true;
}
QString name = databaseNameLineEdit->text();
QModelIndex index = treeView->currentIndex();
QString path = dirModel->filePath(index);
setupDatabaseError result =
addDatabase_->mainWindow_->dbManager_->addDatabase(name.toStdString(),
path.toStdString(), recursive);
switch (result) {
case NAME_TAKEN : {
qApp->restoreOverrideCursor();
myThread->quit();
QMessageBox::information(this, "baduK", "Unable to create database with given name.\n" "Choose a different Database name.");
return;
}
case DIR_TAKEN : {
qApp->restoreOverrideCursor();
myThread->quit();
QMessageBox::information(this, "baduK", "Unable to create database directory.\n"
"Choose a different Database name.");
return;
}
case ACCEPT : {
break;
}
case NO_SGF : {
qApp->restoreOverrideCursor();
myThread->quit();
QMessageBox::information(this, "messageDlg", "Specified Directory has no SGF files.\n"
"Choose a different Directory.");
QString name = databaseNameLineEdit->text();
std::string strName = name.toStdString();
addDatabase_->mainWindow_->dbManager_->deleteDatabase(strName);
return;
}
case BAD_DIRECTORY : {
qApp->restoreOverrideCursor();
myThread->quit();
QMessageBox::information(this, "baduK", "Specified Directory does not exist.\n"
"Choose a different Directory.");
if (ACCEPT != result) {
QString name = databaseNameLineEdit->text();
std::string strName = name.toStdString();
addDatabase_->mainWindow_->dbManager_->deleteDatabase(strName);
}
return;
}
case UNABLE_TO_CREATE_DIR : {}
case BAD_SGF : {}
case CANCEL : {}
}
addDatabase_->stackedWidget->setCurrentWidget(addDatabase_->progressPage);
addDatabase_->progressPage->labelCurrentTimeData->setText("0:00 Seconds");
addDatabase_->repaint();
addDatabase_->update();
result = addDatabase_->mainWindow_->dbManager_->setupDatabase(
addDatabase_->mainWindow_, eraseDuplicates);
qApp->restoreOverrideCursor();
myThread->quit();
switch (result) {
case NAME_TAKEN : {}
case DIR_TAKEN : {}
case BAD_DIRECTORY : {}
case NO_SGF : {}
case UNABLE_TO_CREATE_DIR : {}
case BAD_SGF : {}
case ACCEPT : {
addDatabase_->progressPage->finishButton->setEnabled(true);
break;
}
case CANCEL : {
if (true == addDatabase_->progressPage->isBackClicked_) {
addDatabase_->progressPage->back();
}
//.........这里部分代码省略.........