您尚未显示代码将spinbox2的“
valueChanged”信号与进行连接的位置
function。您正在建立连接吗?同样,您提供的代码
function似乎不完整。
您可以尝试如下操作:
spinbbox2.valueChanged.connect(handler)# Or this which works for Python 3.5spinbbox2.valueChanged[int].connect(handler)# The function handler called is called whenever# value in spinbox2 is changed and parameter to# handler is the new value of spinbox2def handler(value): spinbox1.setMaximum(value)



