Corrected some Python 3.10 precision related issues. eric7

Sun, 26 Dec 2021 17:40:02 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 26 Dec 2021 17:40:02 +0100
branch
eric7
changeset 8856
df77fbfc150f
parent 8855
6bd9f3d7896e
child 8857
8191d15b8974

Corrected some Python 3.10 precision related issues.

eric7/WebBrowser/Download/DownloadItem.py file | annotate | diff | comparison | revisions
eric7/WebBrowser/Download/DownloadManager.py file | annotate | diff | comparison | revisions
--- a/eric7/WebBrowser/Download/DownloadItem.py	Sun Dec 26 12:53:03 2021 +0100
+++ b/eric7/WebBrowser/Download/DownloadItem.py	Sun Dec 26 17:40:02 2021 +0100
@@ -64,6 +64,7 @@
         super().__init__(parent)
         self.setupUi(self)
         
+        # TODO: change to use style sheet
         p = self.infoLabel.palette()
         p.setColor(QPalette.ColorRole.Text, Qt.GlobalColor.darkGray)
         self.infoLabel.setPalette(p)
@@ -351,7 +352,7 @@
         currentValue = 0
         totalValue = 0
         if self.__bytesTotal > 0:
-            currentValue = self.__bytesReceived * 100 / self.__bytesTotal
+            currentValue = self.__bytesReceived * 100 // self.__bytesTotal
             totalValue = 100
         self.progressBar.setValue(currentValue)
         self.progressBar.setMaximum(totalValue)
--- a/eric7/WebBrowser/Download/DownloadManager.py	Sun Dec 26 12:53:03 2021 +0100
+++ b/eric7/WebBrowser/Download/DownloadManager.py	Sun Dec 26 17:40:02 2021 +0100
@@ -314,7 +314,7 @@
         icon = self.style().standardIcon(QStyle.StandardPixmap.SP_FileIcon)
         itm.setIcon(icon)
         self.downloadsView.setRowHeight(
-            row, itm.sizeHint().height() * self.__rowHeightMultiplier)
+            row, int(itm.sizeHint().height() * self.__rowHeightMultiplier))
         # just in case the download finished before the constructor returned
         self.__updateRow(itm)
         self.changeOccurred()
@@ -343,7 +343,7 @@
         
         self.downloadsView.setRowHeight(
             row,
-            itm.minimumSizeHint().height() * self.__rowHeightMultiplier)
+            int(itm.minimumSizeHint().height() * self.__rowHeightMultiplier))
         
         remove = False
         

eric ide

mercurial