When I click on the first button, the information about the second button are launched.
I did a print just before the connect and I pass the good informations so I don't understand
Here's my code :
def load_list_program(self):
date = datetime.datetime.now()
select_ = []
from_ = ["Programme"]
actualY = -2
for y in range(date.year - 1, date.year + 2):
actualY += 1
res = requetes_pre_def.find_prog_by_year(str(y))
print(res)
for prog in res:
prog.print_prog()
print(prog.ien)
prog_year_button = PyQt5.QtWidgets.QPushButton(prog.prog_name)
prog_year_button.clicked.connect(lambda: self.open_prog(prog))
prog_year_button.setCheckable(True)
prog_year_button.toggle()
prog_year_button.setObjectName(prog.prog_name)
if actualY == -1:
self.zoneY1.addWidget(prog_year_button)
elif actualY == 0:
self.zoneY2.addWidget(prog_year_button)
elif actualY == 1:
self.zoneY3.addWidget(prog_year_button)
print("TEST")