さて、今夜はこの問題に直面しています:
[...]
connect(startButton, SIGNAL(clicked()), this, SLOT(startCalculation()));
connect(stopButton, SIGNAL(clicked()), this, SLOT(stopCalculation()));
[...]
void MainWindow::startCalculation()
{
qDebug() << "hello";
this->startButton->setDisabled(true);
this->stopButton->setEnabled(true);
this->calcStatus = true;
this->calculate();
}
void MainWindow::stopCalculation()
{
this->startButton->setEnabled(true);
this->stopButton->setDisabled(true);
this->calcStatus = false;
}
void MainWindow::calculate()
{
qDebug() << "hello";
while(this->calcStatus)
{
}
}
[...]
calculate() プロシージャをいつでも停止できるようにしようとしていますが、開始直後に制御できなくなり、STOP を押すことができません。もちろん、私の将来の計画では、calculate() は実際のもの (熱伝達シミュレーションなど) を「計算」します。
提案をありがとう。P.