refs #380, QConcurrent vs QThread sample and fix

* in same step fixed nullptr issue in worker (with no parent)
* Changed from QConccurennt::run to CWorker in core
This commit is contained in:
Klaus Basan
2015-02-09 19:26:03 +01:00
parent 50e9be8dd3
commit f0db7ed660
6 changed files with 212 additions and 18 deletions

View File

@@ -46,8 +46,11 @@ namespace BlackMisc
auto *thread = new CRegularThread(m_owner);
QString ownerName = m_owner->objectName().isEmpty() ? m_owner->metaObject()->className() : m_owner->objectName();
thread->setObjectName(ownerName + ":" + m_name);
if (m_owner)
{
QString ownerName = m_owner->objectName().isEmpty() ? m_owner->metaObject()->className() : m_owner->objectName();
thread->setObjectName(ownerName + ":" + m_name);
}
setObjectName(m_name);
moveToThread(thread);