[Qt-interest] QThread eventloop problems
Sergey Shekyan
sergio_arm at yahoo.com
Thu Feb 25 18:50:20 CET 2010
Hi,
I am trying to have multithreaded app with QWebPage isntance in every thread.
the way I am creating it is:
void
MyServer::incomingConnection(int socketDescriptor)
{
MyThread* thread = new MyThread(this, socketDescriptor);
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
thread->start();
}
and run() of MyThread is:
void
MyThread::run(){
MyPage page(sockfd);
exec();
}
where, MyPage is subclassed from QObject, and has QWebPage member pointer, and slots to handle signals from QWebPage.
So the problem is everything works if I am creating MyPage in main event loop, and looks like I don't have the event loop, and no signals of QWebPage are triggered if MyPage is in MyThread.
What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100225/d12e0cf5/attachment.html
More information about the Qt-interest-old
mailing list