typedef QMap<QString, double> QDbMap;
class TestComputer : public QObject
class TestLoadDb : public QObject
class TestWidget : public QFrame
{
TestComputer * m_computer;
TestLoadDb * m_loadDb;
TestSetDb *m_setDb;
}
GuoheWidget::GuoheWidget(QString &name)
{
m_computer = new GuoheComputer;
m_computer->setFileNameCal(m_fileNameCal);
QThread * threadComputer= new QThread(this);
m_computer->moveToThread(threadComputer);
qRegisterMetaType<QDbMap>("QDbMap");
m_loadDb = new GuoheLoadDb;
m_loadDb->setFileNameInTab(m_fileNameInTab);
QThread * threadLoadDb = new QThread(this);
m_loadDb->moveToThread(threadLoadDb);
connect(m_loadDb,SIGNAL(signalDbLoad(QDbMap)),m_computer,SLOT(compute(QDbMap)));
connect(m_loadDb,SIGNAL(signalDbLoad(QDbMap)),m_dataShowIn,SLOT(updateDataValue(QDbMap)));
m_setDb = new GuoheSetDb(m_fileNameOutTab);
QThread * threadSetDb = new QThread(this);
m_setDb->moveToThread(threadSetDb);
connect(m_computer,SIGNAL(sigResultMap(QDbMap)),m_setDb,SLOT(writeDbSlot(QDbMap)));
connect(m_computer,SIGNAL(sigResultMap(QDbMap)),m_dataShowOut,SLOT(updateDataValue(QDbMap)));
threadComputer->start();
threadLoadDb->start();
threadSetDb->start();
}