Custom Signal/Slot connection is not working (Slot is not called)
-
I am trying to connect a Signal to a custom slot that I have defined. The connection is done in the constructor of my class which extends QWidget. I am trying to catch when a slider in my scrollArea changes value and call the slot. My code for the connection is:
connect(ui.scrollArea->verticalScrollBar(), SIGNAL(sliderMoved(int)), this, SLOT(on_verticalScrollBar_sliderChanged(int)));
However when I move the slider in my scrollArea, the corresponding slot is never called and thus not doing anything.
-
Please post the code where you do the connect and where you emit the signal.
Also please use the new signal/slot syntax to make sure the signal and slot signatures are correct. -
@Christian-Ehrlicher Using the new syntax already seems to have solved the issue. Thank you!