PDA

View Full Version : Qt and C application



omega36
23rd February 2009, 14:09
Is it possible to use Qt with a C application ?

Thanks!

caduel
23rd February 2009, 15:05
Not for a "pure" C app.
So it depends on how you define a "C application". If you provide a C interface (i.e. use extern "C") that the Qt/C++ stuff can hide behind, then, yes, you can.
(So you need C++ to use Qt, but you can often provide a C interface to your C++ code using Qt.)

But you can use C with a Qt application.

HTH

omega36
23rd February 2009, 15:50
I provide a Qt interface and a "pure" C code !!!
So ?

thanks

caduel
23rd February 2009, 16:00
You can't.

You need to use C++ code to program with Qt.
You can (again in C++!) provide a C api to your gui code.
Then call this C api from the rest of your app.

omega36
23rd February 2009, 16:14
thanks again :)