Files
chenzhen 222dda1e43 1,新增“App_ThermalImageSystem”;
2,新增“Apps”;
3,新增“Common”;
4,新增“FileList”;
5,新增“MediaX”;
6,新增“OpenSource”;
7,新增“Samples”;
8,新增“SoftwareBusinessLines”.
2026-02-14 23:03:23 +08:00

62 lines
1.1 KiB
C++

#include "GuiInvoker.h"
#include <QMetaType>
#pragma data_seg("Shared")
int volatile g_bRegistered_GuiInvoker = false;
#pragma data_seg()
#pragma comment(linker,"/section:Shared,RWS")
GuiInvoker::GuiInvoker(QObject* parent)
: QThread(parent)
{
/*
if(!g_bRegistered_GuiInvoker)
{
qRegisterMetaType<GuiInvoker_Func>("GuiInvoker_Func");
g_bRegistered_GuiInvoker = true;
}
*/
qRegisterMetaType<GuiInvoker_Func>("GuiInvoker_Func");
connect(this, &GuiInvoker::sigInvoke, this, &GuiInvoker::OnInvoke);
this->start();
}
GuiInvoker::~GuiInvoker()
{
this->wait();
disconnect(this, &GuiInvoker::sigInvoke, this, &GuiInvoker::OnInvoke);
}
void GuiInvoker::start()
{
QThread::start();
}
void GuiInvoker::wait()
{
QThread::wait();
}
void GuiInvoker::run()
{
return;
}
void GuiInvoker::Invoke(GuiInvoker_Func pFunc, void* pParams, void* pOwner)
{
emit sigInvoke(pFunc, pParams, pOwner);
}
void GuiInvoker::OnInvoke(GuiInvoker_Func pFunc, void* pParams, void* pOwner)
{
if (nullptr != pFunc)
{
pFunc(pParams, pOwner);
}
}