[Qt-interest] Setting a label's value from a slider automatically on launch

jjDaNiMoTh jjdanimoth at gmail.com
Wed Aug 24 18:52:18 CEST 2011


2011/8/24 David Doria <daviddoria at gmail.com>:
> I have a slider and a label on my QMainWindow. In QtDesigner, I've
> created a signal/slot pair so that the slider's value is displayed in
> the label. When I run the program and slide the slider, the label is
> updated appropriately. However, the label does not take the correct
> value until the slider is moved for the first time. Is there a way to
> automatically make the label take the slider's value as soon as the
> program is started (before the slider is moved)?

Remember that if slider isn't moved, no signals are fired, so you need
to set the first value by hand.



More information about the Qt-interest-old mailing list