Hi,
The DLL is loaded alright, I'm able to call functions getConst and getCounter in IBHandler, when it is loaded.
But the mainloop in IBHandler is not running.
#include "ibkernel.h"
IBKernel
::IBKernel(QObject *parent
) :{
}
IBKernel::~IBKernel()
{
}
IBHandler* IBKernel::getHandler()
{
return handler;
}
void IBKernel::startKernel()
{
exec();
}
void IBKernel::stopKernel()
{
quit();
}
void IBKernel::run()
{
handler = new IBHandler();
//handler->moveToThread(this);
QTimer::singleShot(10, handler,
SLOT(MainLoop
()));
exec();
delete handler;
handler = 0;
}
#include "ibkernel.h"
IBKernel::IBKernel(QObject *parent) :
QThread(parent)
{
}
IBKernel::~IBKernel()
{
}
IBHandler* IBKernel::getHandler()
{
return handler;
}
void IBKernel::startKernel()
{
exec();
}
void IBKernel::stopKernel()
{
quit();
}
void IBKernel::run()
{
handler = new IBHandler();
//handler->moveToThread(this);
QTimer::singleShot(10, handler, SLOT(MainLoop()));
exec();
delete handler;
handler = 0;
}
To copy to clipboard, switch view to plain text mode
#include "ibhandler.h"
IBHandler
::IBHandler(QObject *parent
) :{
mainLoopCnt = 30;
}
IBHandler::~IBHandler()
{
}
int IBHandler::getCounter()
{
return mainLoopCnt;
}
int IBHandler::getConst()
{
return 99;
}
void IBHandler::MainLoop()
{
// THIS STOPS or NEVER STARTS in the static released version
mainLoopCnt++;
QTimer::singleShot(0,
this,
SLOT(MainLoop
()));
}
#include "ibhandler.h"
IBHandler::IBHandler(QObject *parent) :
QObject(parent)
{
mainLoopCnt = 30;
}
IBHandler::~IBHandler()
{
}
int IBHandler::getCounter()
{
return mainLoopCnt;
}
int IBHandler::getConst()
{
return 99;
}
void IBHandler::MainLoop()
{
// THIS STOPS or NEVER STARTS in the static released version
mainLoopCnt++;
QTimer::singleShot(0, this, SLOT(MainLoop()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks