【发布时间】:2015-07-26 07:03:32
【问题描述】:
我想创建一个仅包含表盘的简单 Qwt 小部件。表盘上显示的值(即表盘的位置)应根据我从单独线程收集的一些输入数据进行更新。
我可以在主窗口类中生成我的表盘,我可以在主窗口类中的单独线程上创建和启动数据捕获,如下所示:
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
{
// create the dial
QDial* pDial = new QDial;
// create the data class to capture data from an external source
DataClass* pData = new DataClass;
// start the data class thread
pData->Start();
// I can get the latest value of data at any instant like this:
int x = pData->GetData();
// I need to connect the data value to the dial, so that the
// dial always displays the value of the data capture device.
}
我可以插入什么,以便不断调用 GetData() 来更新表盘上显示的值?
【问题讨论】:
标签: multithreading qt plot real-time qwt