mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Fix divided by 0 problem
This commit is contained in:
parent
82471a0e39
commit
3ad79a5888
1 changed files with 4 additions and 1 deletions
|
@ -56,7 +56,10 @@ class WelcomePagesModel(ListModel):
|
||||||
# Returns a float number in [0, 1] which indicates the current progress.
|
# Returns a float number in [0, 1] which indicates the current progress.
|
||||||
@pyqtProperty(float, notify = currentPageIndexChanged)
|
@pyqtProperty(float, notify = currentPageIndexChanged)
|
||||||
def currentProgress(self) -> float:
|
def currentProgress(self) -> float:
|
||||||
return self._current_page_index / len(self._items)
|
if len(self._items) == 0:
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
return self._current_page_index / len(self._items)
|
||||||
|
|
||||||
# Indicates if the current page is the last page.
|
# Indicates if the current page is the last page.
|
||||||
@pyqtProperty(bool, notify = currentPageIndexChanged)
|
@pyqtProperty(bool, notify = currentPageIndexChanged)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue