PDA

View Full Version : Connecting Vertical Slider + PushButton to change variable in class



adatter
18th May 2014, 14:18
Hi!
I want user to choose a value using Vertical Slider and then click PushButton to accept chosen value.
Signal (?) should change variable in other class and QLineEdit in the same window. How to implement this?
Will it be a problem that I used QtDesigner to create those widgets?

anda_skoa
19th May 2014, 08:04
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,
_