From 96081a7588e37260ade913c6a21b7fa204d56318 Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Tue, 3 Mar 2015 18:31:26 +0300 Subject: [PATCH] Async step change fix due to bug in some QT versions --- mainwindow.cpp | 16 ++++++++-------- mainwindow.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 288ce5f..d22ba5b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -690,16 +690,16 @@ void MainWindow::checkSDStatus() if(sdWatcher.isFinished() && sdprinting) injectCommand("M27"); } -void MainWindow::on_stepspin_valueChanged(double arg1) +void MainWindow::on_stepspin_valueChanged(const QString &arg1) { - if(arg1 < 1) ui->stepspin->setSingleStep(0.1); - else if(arg1 >=10) ui->stepspin->setSingleStep(10); - else if((int)arg1 >= 1) ui->stepspin->setSingleStep(1); + if(arg1.toFloat() < 1) ui->stepspin->setSingleStep(0.1); + else if(arg1.toFloat() >=10) ui->stepspin->setSingleStep(10); + else if(arg1.toFloat() >= 1) ui->stepspin->setSingleStep(1); } -void MainWindow::on_estepspin_valueChanged(double arg1) +void MainWindow::on_estepspin_valueChanged(const QString &arg1) { - if(arg1 < 1l) ui->estepspin->setSingleStep(0.1); - else if(arg1 >=10) ui->estepspin->setSingleStep(10); - else if((int)arg1 >= 1) ui->estepspin->setSingleStep(1); + if(arg1.toFloat() < 1) ui->estepspin->setSingleStep(0.1); + else if(arg1.toFloat() >=10) ui->estepspin->setSingleStep(10); + else if(arg1.toFloat() >= 1) ui->estepspin->setSingleStep(1); } diff --git a/mainwindow.h b/mainwindow.h index 52c10cb..5448555 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -120,9 +120,9 @@ private slots: void checkSDStatus(); void updateSDStatus(); - void on_stepspin_valueChanged(double arg1); + void on_stepspin_valueChanged(const QString &arg1); - void on_estepspin_valueChanged(double arg1); + void on_estepspin_valueChanged(const QString &arg1); signals: void sdReady();