PDA

View Full Version : Please help me qt browser



nguahoang205
30th July 2012, 05:30
Hi,
I am new qt programmer. I make a program run qt_browser demos. I use this program to call this part code:

Q_INIT_RESOURCE(data);
BrowserApplication application(qtArgc, (char**)qtArgv);
if (!application.isTheOnlyBrowser())
return 0;
application.newMainWindow();
exit = application.exec();

I call the first, it is OK, but when I close mainwindows and call again, it do not run and display "WARNING: QApplication was not created in the main() thread"
, then system is quited.
Anyone help me?
Thanhs

ChrisW67
30th July 2012, 05:52
The warning is clear enough; do not create the QApplication instance, in this case BrowserApplication I guess, outside the main (primary) thread. Since you don't show us how you are using threads we cannot really help you with your atypical Qt code.