I added some QProgressBar inside a list and I need to use that list to set the values of these ProgressBar
self.DataBar = list()
for Nb in range(0, 4):
self.DataBar.append(BarPourcentage(self))
self.DataBar[Nb].setValue(12)
self.DataBar[Nb].show()
print(self.DataBar[Nb].value())
self.DataBar[2].setValue(50) #This line isn't working, it works only when Nb=0
class BarPourcentage(QtWidgets.QProgressBar): #My Class
def __init__(self, parent = None):
super(BarPourcentage, self).__init__()
self.setParent(parent)
self.setGeometry(200,80,130,20)
With the print, it prints the 4 values of there 4 progressbar. I can see these 4 progressbar on my gui but i can't change their value individually by trying DataBar[Value].setValue(50) when value isn't equal to 0. Error : list index out of range.