Originally Posted by
JohannesMunk
You are welcome!
Hi I have a new problem. Some posts ago you explained to me how to connect a signal to a slots of 2 "unknow" objects, eather one is part of the other.
You gave to me this clear example:
AudioDevice* ad = new AudioDevice();
...
SoundData* sd = new SoundData();
...
::connect(ad,SIGNAL(soundStopped()),sd,SLOT(someSLOT()));
AudioDevice* ad = new AudioDevice();
...
SoundData* sd = new SoundData();
...
QObject::connect(ad,SIGNAL(soundStopped()),sd,SLOT(someSLOT()));
To copy to clipboard, switch view to plain text mode
Supposing ad (or object A in general has a slider)
I would connect the "valueChanged(int)" signal of the QSlider sl that's part of the object A with a slot that's part of the object B
Something like this:
AudioDevice* ad = new AudioDevice(); //ad has a QSlider sl
...
SoundData* sd = new SoundData(); //sd has a slot slot_sd(int);
...
::connect(ad->sl,SIGNAL(valueChanged(int)),sd,SLOT(slot_sd(int)));
AudioDevice* ad = new AudioDevice(); //ad has a QSlider sl
...
SoundData* sd = new SoundData(); //sd has a slot slot_sd(int);
...
QObject::connect(ad->sl,SIGNAL(valueChanged(int)),sd,SLOT(slot_sd(int)));
To copy to clipboard, switch view to plain text mode
Is it possible?
Best Regards