【发布时间】:2017-04-01 03:28:13
【问题描述】:
我在我的 GUI 应用程序中使用 QSlider,以便在 QSlider 中更改值后执行繁重的任务。我这样做如下。
self.slider.valueChanged.connect(self.value_changed) # Inside __init__() function
def value_changed(self): # Inside the class
# Do the heavy task
但是我不能顺利改变滑块的值,因为每次改变值都在运行繁重的任务。
我需要的是在值改变后运行繁重的任务,但前提是滑块的值暂时没有改变。
我不知道如何在 python 中做到这一点。有什么帮助..?
【问题讨论】:
-
你可以解释的更好,也许你需要使用QThread
标签: python python-3.x pyqt5 qslider