Type casting in Qt for Python 3.10

This commit is contained in:
2024-02-29 11:46:42 +01:00
parent 886f7e0972
commit aa31b65750

View File

@@ -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