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.
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().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, you'll need to pass it. See the explanation in my previous post.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.






rocessPendingDatagrams."
irectConnection as the fifth parameter for the connect() method. That had no affect.
Reply With Quote
Bookmarks