Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError: setValue(self, int): argument 1 has unexpected type 'float' #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SDEllipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def run(self):
"""Run method that performs all the real work"""
# Do some initialisations
# The progressbar
self.dlg.progressBar.setValue(0.0)
self.dlg.progressBar.setValue(0)

# Prepare for sorting
layers = QgsProject.instance().mapLayers()
Expand Down
2 changes: 1 addition & 1 deletion SDEllipse_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def workerFinished(self, ok, ret):
else:
self.showError(self.tr('Not able to create ellipse') + '!')
# Update the user interface
self.progressBar.setValue(0.0)
self.progressBar.setValue(0)
self.button_box.button(QDialogButtonBox.Ok).setEnabled(True)
self.button_box.button(QDialogButtonBox.Close).setEnabled(True)
self.button_box.button(QDialogButtonBox.Cancel).setEnabled(False)
Expand Down
4 changes: 2 additions & 2 deletions SDEllipse_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Worker(QtCore.QObject):
relative to x / east.
'''
# Define the signals used to communicate
progress = QtCore.pyqtSignal(float) # For reporting progress
progress = QtCore.pyqtSignal(int) # For reporting progress
status = QtCore.pyqtSignal(str)
error = QtCore.pyqtSignal(str)
# Signal for sending over the result:
Expand Down Expand Up @@ -290,7 +290,7 @@ def calculate_progress(self):
percentage_new = (self.processed * 100) / self.feature_count
if percentage_new > self.percentage:
self.percentage = percentage_new
self.progress.emit(self.percentage)
self.progress.emit(int(self.percentage))

def kill(self):
'''Kill the thread by setting the abort flag'''
Expand Down