Quote Originally Posted by db View Post
1) Previously, it was suggested that I may need a Q_OBJECT in the Thread class; I didn’t think so because I’m not using a widget (may be an incorrect assumption on my part). I put it in the code and got linker errors:

"Undefined reference to vtable for CHostIFReceive."

My understanding is that it thinks I’m using a virtual object that hasn’t been declared, I didn’t think I was.
Make sure the declaration is in a header file and that the header file is listed in .pro file. Then, re-run qmake to get new Makefiles with correct rules for running moc as required.

2) Another suggesting was that I should not create the QUpdSocket in the QThread constructor but in the run() method (all the examples I’ve seen have it in the constructor). I got the following runtime errors:

"QObject can not create children for a parent that is in a different thread.
(Parent is QThread(0xbfefb140), parent’s thread is QThread(0x9e9c2e8), current thread is QThread(0xbfefb140)
Object::connect: No such slot QThread:rocessPendingDatagrams."
Yes, QThread::run() is the correct place to create it. Just don't pass any parent. Again, the QThread object itself aka "this" lives in main thread which is different thread which is being executed in QThread::run().

3) Final suggestion was to make sure that I pass in Qt:irectConnection as the fifth parameter for the connect() method. That had no affect.
Yes, you'll need to pass it. See the explanation in my previous post.