From aa31b65750bf64e516db097d3c56687d37a15d9e Mon Sep 17 00:00:00 2001 From: chrin Date: Thu, 29 Feb 2024 11:46:42 +0100 Subject: [PATCH] Type casting in Qt for Python 3.10 --- guiframe.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guiframe.py b/guiframe.py index e7dc229..f6f7a3d 100644 --- a/guiframe.py +++ b/guiframe.py @@ -1584,7 +1584,7 @@ class GUIFrame(QWidget): line.setValue(value) line.setAlignment(Qt.AlignRight) #required fm = QFontMetricsF(line.font()) - param_width = fm.maxWidth() * (len(str(max_val))) # + len(str(step))) + param_width = fm.maxWidth() * (len(str(max_val))) line.setMaximumWidth(int(param_width)) return line @@ -1595,8 +1595,8 @@ class GUIFrame(QWidget): line.setObjectName("Write") value_for_width = max(value, key=len) fm = QFontMetricsF(line.font()) - param_width = fm.maxWidth() * (len(str(value_for_width)) * 0.5) # + len(str(step))) - line.setFixedWidth(param_width) + param_width = fm.maxWidth() * (len(str(value_for_width)) * 0.5) + line.setFixedWidth(int(param_width)) return line