Count a model bigger than two gigabytes upwards

Qt's int is C++'s 32-bit one, so the progress of a 2.3 GB download arrived
at the other end of the signal as -1805209440, which is the real figure
less 2^32. The file was landing correctly; only the line under it was
wrong, reading "1.0 MB of -1805209440 B (-1%)".
This commit is contained in:
yusufipk
2026-08-01 20:14:50 +03:00
parent 634b46fcb0
commit f3573908d0
2 changed files with 13 additions and 1 deletions
+3 -1
View File
@@ -119,7 +119,9 @@ class LocalModelBox(QGroupBox):
_listed = pyqtSignal(list, str)
_quants = pyqtSignal(list, str)
_progress = pyqtSignal(int, int)
# qint64 rather than int, which is C++'s 32-bit one: a 2.3 GB model is more
# than fits in it, and the count comes out the far side negative.
_progress = pyqtSignal("qint64", "qint64")
_finished = pyqtSignal(str, str)
_installed = pyqtSignal(str, str)