I'm trying to reconnect a signal to the same slot but with a different parameter. This would work if I just wanted to reconnect the same signal to a diferent slot without using parameters or lambda functions but I need to do it this way.
At first I tried something like this:
connect(remove_btn,&QPushButton::clicked,[this, id] {function1(varA);});
connect(remove_btn,&QPushButton::clicked,[this, id] {function1(varB);});
function1
receives varA
and never varB
.
I found a way to do this by keeping a list of the connections and when I wanted to modify the parameter I would just disconnect the old one and make a new connection.
What I'd like to know is if is there a way to make this modification without the need of keeping track of all the connections and go through the discconnect/connect process.