You can use a slot connected to the slider's valueChanged() signal if you want to update the line edit and variable when the slider is dragged.
Then, in the slot connected to the button's clicked() signal you do whatever action you want to do with the new value.

If you don't need live update, you only need the slot connected to the button's clicked() signal.

And no, it does not change anything if you create the widgets using designer.

Cheers,
_