progress bar arguments type int

This commit is contained in:
Joseph Timothy Foley 2024-04-02 16:06:04 +02:00
parent 625ba9d698
commit 6919de165e

View File

@ -264,7 +264,7 @@ class QSpectrumAnalyzerMainWindow(QtWidgets.QMainWindow, Ui_QSpectrumAnalyzerMai
def update_progress(self, value):
"""Update progress bar"""
value *= 1000
value_max = self.intervalSpinBox.value() * 1000
value_max = int(self.intervalSpinBox.value() * 1000)
if value_max < 1000:
return
@ -300,7 +300,7 @@ class QSpectrumAnalyzerMainWindow(QtWidgets.QMainWindow, Ui_QSpectrumAnalyzerMai
self.start_timestamp = self.prev_data_timestamp
if self.intervalSpinBox.value() >= 1:
self.progressbar.setRange(0, self.intervalSpinBox.value() * 1000)
self.progressbar.setRange(0, int(self.intervalSpinBox.value() * 1000))
else:
self.progressbar.setRange(0, 0)
self.update_progress(0)