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
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
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
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()));
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:
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
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
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
] 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