Re: [Interest] Threading Question

2014-10-10 Thread Alan Ezust
From what I understand, moveToThread() requires a parent-child relationship between the objects for the subtree to include them. If the QTimer was a subobject (data member) rather than a pointer to another heap object with the parent set, then the QTimer won't be moved to the other thread along

Re: [Interest] Threading Question

2014-10-09 Thread Jason Kretzer
Thanks for the response. Yeah, I have placed qDebug() just before and just after the emit. The one before always prints, the one after never does except in the following case. If I change the connection to QueuedConnection, then the qDebug right after does print, the rest of the function

Re: [Interest] Threading Question

2014-10-09 Thread Reinhardt Behm
On Thursday 09 October 2014 03:32:20 Jason Kretzer wrote: Thanks for the response. Yeah, I have placed qDebug() just before and just after the emit. The one before always prints, the one after never does except in the following case. If I change the connection to QueuedConnection, then

Re: [Interest] Threading Question

2014-10-09 Thread Jason Kretzer
Ack! You are correct. I guess I would do something like this to remedy that: in the main: BackgroundTaskManager::init(); QThread *thread = new QThread(); connect(thread, SIGNAL(started()), BackgroundTaskManager::instance(), SLOT(startTimer()));

Re: [Interest] Threading Question

2014-10-09 Thread Constantin Makshin
The description of QObject::moveToThread() says the whole object's subtree is moved, so that hypothesis doesn't sound very plausible. On Oct 9, 2014 3:06 PM, Jason Kretzer ja...@gocodigo.com wrote: Ack! You are correct. I guess I would do something like this to remedy that: in the main:

[Interest] Threading Question

2014-10-08 Thread Jason Kretzer
I am a bit confused on threading. Lets say I have Thread A — which is where the program is started — has main(), etc. Inside of main() I instantiate a class called BackgroundClass and I move it to another thread (Thread B). BackgroundClass::init(); QThread *thread = new

Re: [Interest] Threading Question

2014-10-08 Thread Jason Kretzer
Addendum at the bottom… On Oct 8, 2014, at 11:42 PM, Jason Kretzer ja...@gocodigo.com wrote: I am a bit confused on threading. Lets say I have Thread A — which is where the program is started — has main(), etc. Inside of main() I instantiate a class called BackgroundClass and I move it

Re: [Interest] Threading Question

2014-10-08 Thread Constantin Makshin
Two suggestions: 1) add qDebug-s around the emit someSignal(); line to see whether it returns or not, hanging somewhere in validateResult(); 2) try to explicitly specify the Qt::QueuedConnection type for the someSignal() connection — if it helps, then the [most likely] cause is Qt choosing wrong

Re: [Interest] Threading Question

2014-10-08 Thread Tony Rietwyk
] On Behalf Of Jason Kretzer Sent: Thursday, 9 October 2014 2:43 PM To: interest@qt-project.org Subject: [Interest] Threading Question I am a bit confused on threading. Lets say I have Thread A - which is where the program is started - has main(), etc. Inside of main() I instantiate