I'm using a Qt horizontal slider and I want to connect its valueChanged signal to a slot I defined. However I need to access a specific member inside this slot to modify a variable thanks to the int I set with the slider. Until now, my connect line has looked like this:
connect(slider, SIGNAL(valueChanged(int)), this, SLOT(setVariable(int)));
Is it possible to pass more than one argument to my slot? What I'd like to do is something like:
connect(slider, SIGNAL(valueChanged(int)), this, SLOT(setVariable(int, pointerToMember*)));
If not how can I proceed?
Yes, you can, but you need to use new connect style, so you can pass lambda function
Edit: This works only in Qt5 and above