PDA

View Full Version : Qt for non GUI apps?



qwavel
9th March 2009, 00:54
Hi.

I want to write a non-GUI application for Linux (both desktop and embedded) and Windows.

I need the usual classes: networking, threads, etc., and the ones I was using before were tied to my previous employer.

It is my understanding that Qt has these sorts of classes, works on Windows and Linux, and is now LGPL. But can I use these classes for small, non-GUI apps?

I might want to add an optional GUI later, so it would make that easier for me if I were to start using Qt now.

Also, most of the publicly available code uses the C++ STL. I've read that Qt doesn't use the STL. Is that still true?

ComaWhite
9th March 2009, 02:11
Yes you can use all the non-GUI classes in a console based app just replace QApplication with QCoreApplication. Yes Qt can use STL. There are functions to convert Qt contains to STL and vice versa and more. But that is only to allow adaption to non Qt libraries. You shouldn't use it in your code though. You should use Qt wherever possible unless you have a perfect valid reason to not use the Qt contains and what not. But you have to enable STL when compiling. Gentoo doesn't offer it I think for me. I don't know.