cqt

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?


Solution

  • 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.