This is the thread in which QueryWorker works.
More...
#include <querythread.h>
List of all members.
Detailed Description
This is the thread in which QueryWorker works.
Constructor & Destructor Documentation
: QThread(parent)
{
this->specs = specs;
this->m_queryQueue = queue;
}
QueryThread::~QueryThread |
( |
|
) |
|
{
Q_ASSERT(worker);
delete worker;
};
Member Function Documentation
bool QueryThread::cancelQuery |
( |
|
) |
[slot] |
{
Q_ASSERT(QSqlDatabase::database("ThreadConnection", false).driverName() == "QPSQL");
QSqlDriver *drv = QSqlDatabase::database("ThreadConnection", false).driver();
Q_ASSERT(drv);
PGcancel *cancel = PQgetCancel(drv->handle().value<PGconn*>());
Q_ASSERT(cancel);
char *errMsg = NULL;
bool cancelSuccess = (bool) PQcancel(cancel, errMsg, 256);
if (!cancelSuccess) qDebug() << "Canceling connection returned: " << errMsg;
return cancelSuccess;
}
void QueryThread::fwdToWorker |
( |
QueryQueue * |
queue |
) |
[signal] |
void QueryThread::querying |
( |
bool |
|
) |
[signal] |
void QueryThread::run |
( |
|
) |
[protected] |
Reimplemented from QThread.
{
qDebug() << "QueryThread starting, one moment please..." ;
worker = new QueryWorker(specs, m_queryQueue);
connect(this, SIGNAL(fwdToWorker(QueryQueue*)),
worker, SLOT(slotExecute(QueryQueue*)));
qRegisterMetaType<QueryThreadCommand>("QueryThreadCommand");
connect(worker, SIGNAL(signal_result(QueryThreadCommand)),
this, SIGNAL(signal_result(QueryThreadCommand)));
connect(worker, SIGNAL(querying(bool)),
this, SIGNAL(querying(bool)));
qDebug() << "QueryThread started.";
exec();
}
void QueryThread::slot_queryQueue_changed |
( |
QueryQueue * |
queue |
) |
[slot] |
void QueryThread::waitToStart |
( |
|
) |
|
The documentation for this class was generated from the following files: