Does Qt have a C interface?

I've found conflicting answers on the web - some say it does, some say it doesn't. I was unable to find any details in the official Qt documentation either. So does Qt have C bindings or not?


Short answer: no.

If you need a comprehensive GUI toolkit for C, you can use GTK+.

To use Qt, you must have a C++ compiler. But it doesn't mean that your "application logic" can't be written in C, compiled with a C compiler and carefully linked to the C++ part (the GUI with Qt). This application logic can be generic, linkable into other executables (pure-C, mixed C/C++, etc.) It all depends on what you need.

Qt is great for C++, though, and it's a good reason to decide using C++ for a particular project, even if you still want to keep parts in C.


Unfortunately not, but you may shape your program as set of libraries achiving your business logic and write them in C, then you can use a little C++ to bind what you wrote as library with a GUI using QT.

This is a good approach also because later you can reuse your library and implement many other front-ends with different toolkits or languages!


No. Qt is C++. But you could just write C-style code everywhere that doesn't interact/create GUI elements and compile the whole thing with your C++ compiler of choice.


There used to be a Binding called QtC, but searching for it reveals this thread:

From Richard Dale:

I used to maintain C bindings that were used by Objective-C and Qt# bindings. But the Smoke library is much better although it isn't a C binding, and I scrapped the QtC bindings to use smoke instead.

Smoke is here. I have been unable find a clear reference the QtC Bindings anywhere, though I remember hearing about them.