PDA

View Full Version : Using QWebPage in a QThread (QtWebKit)



Knuckles
3rd November 2009, 19:36
Hi Folks,
i try to use QWebPage in a QThread, but this ever ends with:
QObject: Cannot create children for a parent that is in a different thread. can anyone tell me whats wrong with this code:


void WebKitThread::run(){
QWebPage p;
exec();
}
?

WebKitThread is normally derived from QThread.
Run the programm with
QT_FATAL_WARNINGS=1 does not show more helpful messages. With every other QXxx class it is working! For example QDomDocument or QSqlDatabase.
QWebPage should be a normal QObject, so i cant see any reason why this should nod word!

I know that QWidgets cannot be used anywhere else than in the main GUI thread. Is it possible, that QWebPage has some references to QWidget i dont know from?