nimsnx
30th June 2009, 00:17
Hi,
I'm new to Qt and I started writing a library that would perform a simple http operation. When called, the single "public" method for the library will create a QThread, perform an http operation on that thread, and then return to the caller.
It seems that the running of the QThread depends on a QApplication (QEventLoop: Cannot be used without QApplication). Because a QApplication is for managing "the GUI application's control flow and main settings" it doesn't seem that the QApplication should come from the library.
Is it possible to write a library using QHttp and QThread that will link and work successfully both with applications that are and that aren't Qt applications?
If the library can be written so that it will link and work with a non-Qt application, then should the library provide the QApplication for non-Qt apps? Does that even make sense?
Thanks
I'm new to Qt and I started writing a library that would perform a simple http operation. When called, the single "public" method for the library will create a QThread, perform an http operation on that thread, and then return to the caller.
It seems that the running of the QThread depends on a QApplication (QEventLoop: Cannot be used without QApplication). Because a QApplication is for managing "the GUI application's control flow and main settings" it doesn't seem that the QApplication should come from the library.
Is it possible to write a library using QHttp and QThread that will link and work successfully both with applications that are and that aren't Qt applications?
If the library can be written so that it will link and work with a non-Qt application, then should the library provide the QApplication for non-Qt apps? Does that even make sense?
Thanks