The qwtsystemclock class provides a high-resolution clock function (dependent on a specific system ).
Code Analysis:
class QWT_EXPORT QwtSystemClock{public: QwtSystemClock(); virtual ~QwtSystemClock(); bool isNull() const; void start(); double restart(); double elapsed() const; static double precision();private: class PrivateData; PrivateData *d_data;};
The qwtsystemclock class is used as a sampling clock in the qwtsamplingthread class.
--------------------------------------------------------------
Qwtsamplingthread class: the thread that periodically collects samples, inherited from qthread.
Qwtsamplingthread itself is also an abstract base class.
Code Analysis
Class qwt_export qwtsamplingthread: Public qthread {q_objectpublic: Virtual ~ Qwtsamplingthread (); double interval () const; double elapsed () const; Public q_slots: void setinterval (double interval); void stop (); protected: explicit qwtsamplingthread (qobject * parent = NULL); Virtual void run ();/*! Collect a sample \ Param elapsed time since the thread was started in miliseconds */virtual void sample (double elapsed) = 0; // Private: Class privatedata needs to be implemented again; privatedata * d_data ;};
The example of D: \ qwt-6.0.1 \ examples \ oscilloscope. Pro contains examples for the above two classes.