I have QSlider and QSpinBox , and I would like their values to always be equal, so I connected the valueChanged(int)signal slider to the spinboard ' setValue(int), and vice versa: (of course, I also set the min and max equal values)
connect(delay_slider, SIGNAL(valueChanged(int)),
delay_spin, SLOT(setValue(int)));
connect(delay_spin, SIGNAL(valueChanged(int)),
delay_slider, SLOT(setValue(int)));
I tested and it works (at least on my Ubuntu 12.04 LTS x86_64, g ++ 4.6.3, Qt 4.8.1).
Now, I think that when I emit one of the signals, it calls the other, which will trigger the first, which will call the other, etc. How does Qt handle this? Is there a document describing the mechanisms used?
Review: I called it an "event loop" because it has nothing to do with Qt Event Loop
source
share