pyqt5 滑动条显示数值
时间: 2023-08-20 14:04:45 浏览: 214
在PyQt5中,可以使用QSlider或QScrollBar来实现滑动条,并通过连接valueChanged信号将滑动条的值传递给QProgressBar来显示数值。具体实现代码可以参考引用中的代码。在该代码中,QSlider的valueChanged信号与do_valueChanged槽函数连接,通过传递的参数value来设置QProgressBar的当前值。在槽函数中,可以将value转换为字符串,并将其设置为标签(label)的文本,从而实现滑动条显示数值。通过运行该代码,可以看到滑动条的效果和显示的数值。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [pyqt5中QSlider设置实时显示值](https://blog.csdn.net/dodyxangel/article/details/121563838)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [PyQt5之滑块及滑动条控件](https://blog.csdn.net/qq_41597943/article/details/127067273)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文