简体   繁体   English

Python PyQt5 进度条

[英]Python PyQt5 Progress Bar

I need to make a Progress Bar that has "multiple stops".我需要制作一个具有“多个站点”的进度条。 We are currently working on a project to design a train controller.我们目前正在进行一个设计火车 controller 的项目。 In one window we select the cities where we want to stop and if one city is arrived the Progress Bar should go up (for example if we have 10 stops total after the first stop the Progress Bar should go to 10%). In one window we select the cities where we want to stop and if one city is arrived the Progress Bar should go up (for example if we have 10 stops total after the first stop the Progress Bar should go to 10%). Any ideas on how to realize it?关于如何实现它的任何想法?

Note that QProgressBar operates on int s and is exactly what you want:请注意, QProgressBarint上运行,这正是您想要的:

myProgess = QProgressBar()
myProgress.setMaximum(totalNumberOfStations)

for i in range(1, totalNumberOfStations + 1):
    myProgress.setValue(i)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM