I am having a difficulty in understanding qwt oscilloscope example. i understand most of the program roughly, but i can not find the linkage between samplingthread class and plot class.
It seems like chart samples are from samplingthread and it is provided to QwtPlotCurve object in plot class.
However i can not find linkage between samplingthread object and plot object. But when i change the frequency value in samplingthread object, it is applied and appears on plot object (canvas).
Below is part of code (from main.cpp) i do not really understood but please reference full project (need decompress i think) by downloading from http://sourceforge.net/projects/qwt/files/qwt/6.1.2/.
int main( int argc, char **argv )
{
QApplication app( argc, argv );
app.setPalette( Qt::darkGray );
MainWindow window;
window.resize( 800, 400 );
SamplingThread samplingThread;
samplingThread.setFrequency( window.frequency() ); // window.frequency()'s type is double
samplingThread.setAmplitude( window.amplitude() ); // window.amplitude()'s type is double
samplingThread.setInterval( window.signalInterval() ); // window.signalInterval()'s type is double
window.connect( &window, SIGNAL( frequencyChanged( double ) ),
&samplingThread, SLOT( setFrequency( double ) ) );
window.connect( &window, SIGNAL( amplitudeChanged( double ) ),
&samplingThread, SLOT( setAmplitude( double ) ) );
window.connect( &window, SIGNAL( signalIntervalChanged( double ) ),
&samplingThread, SLOT( setInterval( double ) ) );
window.show();
samplingThread.start();
window.start();
bool ok = app.exec();
samplingThread.stop();
samplingThread.wait( 1000 );
return ok;
}
above's window.start() is equal to plot->start(). and i can not find the linkage between plot object and samplingthread object. Can anyone explain this part for me?