Hi,
I'm working on a library, this one canbe used with or without QT. So, I would like to use QThread features but without QApplication or at least find a way to create a DLL that is not bound to QT.
Thanks
Hi,
I'm working on a library, this one canbe used with or without QT. So, I would like to use QThread features but without QApplication or at least find a way to create a DLL that is not bound to QT.
Thanks
If you use QThread you are "bound" with Qt
You can for example use boost threads multi-platform thread library.
pl01 (9th November 2010)
Thanks,
The problem is that I'm working on a C++ library... not a complete application !
Now, my library use boost 1.44. I'm currently porting my library from VS2008 to QT creator.
The problem is that I'm unable to build boost 1.44 for mingw and use it in QTCreator... see this post : http://www.qtcentre.org/threads/3584...d-boost-for-QT
What Zlatomir said still applies.The problem is that I'm working on a C++ library... not a complete application !
You can't use Qt object without linking to Qt.
You can use external sources such as boost, (if/when you succeed in building it) or just normal ptherads - this should be in the libpthread (POSIX theads) MinGW is shipped with, or you can implement your own Thread classes (but I would not recommend that).
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
There is no problem to be "linked" statically in QT :-P
But I don't need a QT Application... by example my library is used with Java or C# !!! So, I just need :
1 - Create a DLL with QT embeded in it
2 - Avoid the use of QApplication because it is not an application
Not sure it is possible !
Disclaimer: i'm no expert, but i don't see a connection between QApplication and QThread, so you should be able to create and use QThreads in a dll.
If you use LGPL license for Qt, you might have some LGPL restrictions about static linking (as far as i know you must share your source too) so consult a lawyer if you decide to go that way.
In short - use QApplication (or QCoreApplication, to be more precise). If the word "application" stings your eyes, you can always write this line:
and use QLolipop instead of QCoreApplication. It surely won't make your code become sweet and sticky. I would worry more about how you intend to run the event loop of your "not application".
Thanks,
But I don't need any event loop !!!! I just need a portable threading library !
If you don't need an event loop then you don't need an application object. And most probably you don't need any QThread objects as well. Just be aware most of Qt things require an event loop to work. Without it I think using Qt just for the QThread object is an overkill and it's much better to use boost or some other similar library.
pl01 (10th November 2010)
Bookmarks