Skip to content

Commit c9c4018

Browse files
committed
better fix
1 parent 8a7dfa6 commit c9c4018

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

mainwindow.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ void MainWindow::batchProcess(QStringList fileList){
11051105
m_contourView->getPlot()->blockSignals(true);
11061106
QSettings settings;
11071107
bool shouldBeep = settings.value("RMSBeep>", true).toBool();
1108-
this->setCursor(Qt::WaitCursor);
1108+
QApplication::setOverrideCursor(Qt::WaitCursor);
11091109
batchIgramWizard::goPb->setEnabled(false);
11101110
batchIgramWizard::addFiles->setEnabled(false);
11111111
batchIgramWizard::skipFile->setEnabled(true);
@@ -1147,11 +1147,11 @@ void MainWindow::batchProcess(QStringList fileList){
11471147
//QObject().thread()->msleep(1000);
11481148
ui->SelectOutSideOutline->setChecked(true);
11491149
if (!batchIgramWizard::autoCb->isChecked()){
1150-
this->setCursor(Qt::ArrowCursor);
1150+
QApplication::restoreOverrideCursor();
11511151
while (m_inBatch && !m_OutlineDoneInBatch && !m_skipItem) {
11521152
QApplication::processEvents();
11531153
}
1154-
this->setCursor(Qt::WaitCursor);
1154+
QApplication::setOverrideCursor(Qt::WaitCursor);
11551155
}
11561156
if (m_skipItem){
11571157
cnt++;
@@ -1167,11 +1167,11 @@ void MainWindow::batchProcess(QStringList fileList){
11671167

11681168
m_batchMakeSurfaceReady = false;
11691169
if (!batchIgramWizard::autoCb->isChecked() && !m_skipItem){
1170-
this->setCursor(Qt::ArrowCursor);
1170+
QApplication::restoreOverrideCursor();
11711171
while (m_inBatch && !m_batchMakeSurfaceReady && !m_skipItem) {
11721172
QApplication::processEvents();
11731173
}
1174-
this->setCursor(Qt::WaitCursor);
1174+
QApplication::setOverrideCursor(Qt::WaitCursor);
11751175
}
11761176
if (m_skipItem){
11771177
m_skipItem = false;
@@ -1301,7 +1301,7 @@ void MainWindow::batchProcess(QStringList fileList){
13011301
batchIgramWizard::addFiles->setEnabled(true);
13021302
batchIgramWizard::skipFile->setEnabled(false);
13031303

1304-
this->setCursor(Qt::ArrowCursor);
1304+
QApplication::restoreOverrideCursor();
13051305
m_contourView->getPlot()->blockSignals(false);
13061306

13071307
}

surfacemanager.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,14 @@ void SurfaceManager::generateSurfacefromWavefront(wavefront * wf){
379379
if (!m_ignoreInverse && (md->cc != 0.0) && md->cc * wf->InputZerns[8] < 0.){
380380
bool reverse = false;
381381
if (m_askAboutReverse){
382-
if (QMessageBox::Yes == QMessageBox::question(0,"should invert?","Wavefront seems inverted. Do you want to invert it?"))
382+
// Temporarily restore cursor so QMessageBox does not show waitCursor
383+
// QGuiApplication::setOverrideCursor do stack so we will go back to previous state (any state)
384+
QGuiApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
385+
bool msgResult = (QMessageBox::Yes == QMessageBox::question(0,"should invert?","Wavefront seems inverted. Do you want to invert it?"));
386+
QGuiApplication::restoreOverrideCursor();
387+
if (msgResult)
383388
{
384-
reverse = true;
389+
reverse = true;
385390
m_askAboutReverse = false;
386391
}else
387392
{

0 commit comments

Comments
 (0)