PDA

View Full Version : C and QT



cap10Ibraim
September 27th, 2010, 11:28 AM
I wrote a C application , now want to make a GUI for this application, can I use QT ? http://qt.nokia.com/
I know about gtk but I'm assuming QT is easier and maybe more powerful ?

dwhitney67
September 27th, 2010, 11:39 AM
IIRC, Qt is based on C++.

So the question you should be asking is whether you can use C from within a C++ application? And the answer is "yes".

cap10Ibraim
September 27th, 2010, 12:29 PM
ok , thanks , next i'll be downloading the complete SDK 500 MB !

nvteighen
September 27th, 2010, 05:05 PM
Qt is a C++ library. AFAIK, you can't use a C++ library in a C program (you can use a C library in a C++ program, though). Either code in C++ or use GTK+, which is a C library.

GTK+ and Qt are pretty much the same. Ok, Qt also has a lot of stuff not related to GUIs, but networking and other stuff but that's because Qt predates the C++ standard... Save for that, they are equally powerful and it's more a matter of taste (or platform-targetting) whether you use any of both.

schauerlich
September 27th, 2010, 05:24 PM
Qt is a C++ library. AFAIK, you can't use a C++ library in a C program (you can use a C library in a C++ program, though). Either code in C++ or use GTK+, which is a C library.

GTK+ and Qt are pretty much the same. Ok, Qt also has a lot of stuff not related to GUIs, but networking and other stuff but that's because Qt predates the C++ standard... Save for that, they are equally powerful and it's more a matter of taste (or platform-targetting) whether you use any of both.

Well, if you write C code but compile with g++ it should work, as long as you avoid some incompatibilities (http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B).

cap10Ibraim
September 27th, 2010, 05:55 PM
Yes I already use g++ for compilation ,
but that's what make me consider Qt http://qt.nokia.com/qt-in-use
I've got his book The.Book.of.Qt.4.The.Art.of.Building.Qt.Applicatio ns(pirated...I Know..)
any other recommendations to get me started