user2872955
user2872955

Reputation: 11

C++ adding two QSliders together?

I have two QSlider-s/QSpinBox-es. Got those working but not sure about the best way of adding the two together to output the total.

Here is a picture of what I got: enter image description here

Upvotes: 0

Views: 89

Answers (1)

Yasser Malaika
Yasser Malaika

Reputation: 156

You need to connect signals form the sliders and spinboxes to slots in your main widget (or some other QObject derived class). Doing this allows your main widget to be informed whenever they are changed, do the addition, and output the result where you want. Check out some of the tutorials included with Qt for more info.

Upvotes: 1

Related Questions