Can I able to use "setMethod" as a slot also?
Solved
General and Desktop
-
Hi,
- I have member
int sampling_rate;
and setter methodvoid setSampling_rate(int);
and getter methodint getSampling_rate();
in ampconfiguration.cpp - I have used also
Q_PROPERTY(int sampling_rate READ getSampling_rate WRITE setSampling_rate NOTIFY valueChanged)
3)Now, In themainwindow.cpp
I want send the value from one object to another object of same class, but not working.
AmpConfiguration Amp1,Amp2; connect(Amp1.sampling_rate,SIGNAL(valueChanged(int)),Amp2.sampling_rate,SLOT(setSampling_rate(int)));
errors:
3 errors link - I have member
-
hi @thippu
I think you have two options.
-
move the void setSampling_rate() from the puclic: section to public slots:
the Q_Property macro should not care either way, I may be wrong however -
use the new QT5 Syntax that way your receiving function does not have to be a defined as
slot
-